.dat file knowledge

Pages: 123
The file doesn't tell the editor what to print. BIt pattern 01001010 is not a command to an editor to display the ASCII letter 'J'. The editor interprets the bit patten as ASCII letter 'J' because it is using ASCII as the coded character set and it presumes the file contains ASCII text characters. If it were using an EBCDIC character set, it would display a cent sign, ยข.

Consider this pattern of bits:

01001011 01001100 01001101 01001110

If an editor interprets this using an ASCII character set, it will display the four characters "KLMN". But if it interprets it as EBCDIC, it will display ".<(+". Either way, the file is just a set of ones and zeros. It might not be a text file at all, but only appear that way if displayed with a text editor. That bit pattern could just as well be the four byte binary representation of decimal integer 1,263,291,726.
Last edited on
closed account (N36fSL3A)
data != command DTS.
What is DTS?
DTS is referring to DTSCode, the user.
Last edited on
Still don't know what you mean. Is there a site I can see explaining it?
The best I can do. I don't know what DTSCode is referring to with his name, but here:
http://www.google.com/#q=DTS

Ask him. :)
Last edited on
I already looked it up, it's just a sound system company... I want to know what you are referring to.
Lumpkin means:

data does not equal command, DTSCode.

Talking to DTSCode.
Oh, I thought it was an actual code haha. When you execute the binary it becomes a command. There is a file on your computer (hidden in the HDD somewhere) called bootmgr which is just a bunch of data (binary) which runs like a command (binary) executed by the machines BIOS. The computer (last time I checked) can't boot without it and is the binary you first create in order to make an OS.
Last edited on
Yes, and if you try to open an exe in notepad, you will get random chars. Data is defined by how you interpret it. I once made a program that made an exe file with text in it. I could open it in notepad and everything. When I tried to run it, it said, "List.exe is not a valid Win32 application."
Yes, and if you try to open an exe in notepad, you will get random chars.

Well, not exactly random, but I get what you mean.

If you want to open any type of file, a hex editor is a better tool than notepad.

For example:
http://sourceforge.net/projects/hexplorer/
or
http://mh-nexus.de/en/hxd/
Agreed.
They are not random, that is just how notepad reads it. I have never used a sexxydecimal viewer before, you can make a binary that can read the plain binary of any file easily. It may not work as well as a hexxy reader but at least it does something.
I guess what the guy meant, was that he would like to know how to deal with .dat files. Like, is there some sort of standard which you should follow when reading/writing this kind of file. For example, if you have csv file or xml file, they all have some common patterns that you use, so even if you don't really know what's it for, you can see what's in there, because you know the pattern. If you open .dat file in text editor, you're gonna have some strange symbols popping up. Your first answer, DTS, was therefore not complete.( no offence of course ;) )



Actually he is right...
I already know everything about binary files, but in a C++ exercise gave me a .dat file where name of students and exam grades were written and asked me to make a program to rank the students...


I was wandering how the hell can a write a program that reads sth that when I open in notepad reads some strange characters...

Can anyone create a small program and explain what the hell is this type of file
I don't know how to do that even if it's text-based. Sorry I tried that before.
Last edited on
The exercise should have provided also the format of the .dat file otherwise the exercise expects you to be able to reverse engineer the file format!

See if you have an exercise before this one that wrote the file.

closed account (N36fSL3A)
Yea, completely ignore what I was saying.
The exercise should have provided also the format of the .dat file otherwise the exercise expects you to be able to reverse engineer the file format!

See if you have an exercise before this one that wrote the file.


Ye, it did:

.dat file

Albocoder B
vin A
Lumpkin C
recalibrate F



Actually it said the .dat file should have this things written but I don't know how to write the file so then I can work with the program... It was written in the paper that the .dat file we were supposed to use was like that... I opened a .dat file and there was nothing normal (no text)...
I opened a .dat file and there was nothing normal (no text)...


If your .dat file contains names you should see text.

You need to find out how the names and grades were stored in the program that wrote the .dat file and then the order they were written to the .dat file.

Were the names stored in a char array of fixed length?
Were the grades integers or doubles or floats?

Were they written to the .dat file in this order?

name1 then grade then name2 then grade then name3 then grade...etc.

See this article http://www.cplusplus.com/articles/DzywvCM9/
If your .dat file contains names you should see text.

You need to find out how the names and grades were stored in the program that wrote the .dat file and then the order they were written to the .dat file.


I was supposed to create that file and then make the program...

The exam was in paper and no soft-data was given (no files)

I dont know how to create a .dat file like the needed one...
Is there any program??
Pages: 123