Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

users.dat Encoding format

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
1297 Views, 5 Replies

users.dat Encoding format

Does anyone happen to know what the encoding format is for the users.dat file in the workshared project backup folder? I would like to use it to get a list of everyone who has worked on the project.  I can open it in notepad and see the list.  There is weird formatting.  Opening it in Code Writter has better formatting, but there is no spaces between users entries.

 

Thanks

5 REPLIES 5
Message 2 of 6
jeremytammik
in reply to: Anonymous

Dear Michael,

Thank you for your query.

I cannot tell off-hand.

Can yu attach a sample file to explore, or would that divulge confidential info?

Best regards,

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 6
Anonymous
in reply to: jeremytammik

I have attached the file, as well as screen shots from Code Writter and Notepad

Message 4 of 6
Anonymous
in reply to: Anonymous

I finally got back to this, and it is a string of escape characters. Sometimes the Users.dat file begins with "\f" sometimes "\r". There is always the null character "\0" in between every character. In between each user entry is a control character. Sometime it is "ACK" sometimes Device Control 1-4.

 

So it looks like the easiest way to get the user list is to parse out the special ascii characters and look for null and a control character next to each other as a break in between users.

Message 5 of 6
jeremytammik
in reply to: Anonymous

Have you tried to interpret this simply as a Unicode text file?

 

Here are my results opening it in a text editor on the Mac:

 

 users_dat_utf8.png

 

 

 

It looks like this in Visual Studio using automatic text encoding:

  users_dat_vs_auto.png

 

Cheers,

 

Jeremy

 

 

 

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 6 of 6
jeremytammik
in reply to: Anonymous

Dear Michael,

 

Here is another suggestion:

 

https://www.crummy.com/software/BeautifulSoup/bs4/doc/#unicode-dammit

 

It is pointed at (along with many others) in the discussion on determining the encoding of text in Python:

 

https://stackoverflow.com/questions/436220/determine-the-encoding-of-text-in-python

 

I found that searching the Internet for 'python determine text encoding':

 

https://duckduckgo.com/?q=python+determine+text+encoding

 

... Later...

 

The encoding is indeed a bit hard to nail down.

 

I installed the Python charset project, which also installs a `chardetect` utility.

 

https://pypi.org/project/chardet

 

Running chardetect on users.dat simply reports:

  

 

$ chardetect users.dat
users.dat: ascii with confidence 1.0

   

Unfortunately, that is no big help.

 

Ah well, you seem to have it under control, anyway.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report