Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a database file ending in .dat, which says nothing to me. Given that it uses a file per database, I assumed that it had to be some sort of sqlite, so tried to open with sqlite3 and has not been recognized as a database. Due to licensing issues, I'm unsure of how much information I can share about this, so I won't be able to upload the file. I know that it's not an encrypted file, and if I cat the file it looks like this:


Any help on how I could export this to a sqlite database? If I only knew what type of database this is! I know that it's read by a program for windows and I'm trying to avoid making a script to read it character by character (there are no return lines) so any hints would be appreciated.

share|improve this question
Do you know which programs use it? Can you include a "hex dump" of the first 15-20 characters? – Randolf Richardson Jun 30 '11 at 20:26
the program that uses it is a standalone exe and I have no access to the source code – omtinez Jun 30 '11 at 20:33
Do you know which language the program was written in? In many cases this can help to narrow down which database technology is probably being used. – Randolf Richardson Jun 30 '11 at 20:34
I'm afraid that I don't, and the gui looks quite strange to me. Running strings on the binary doesn't return anything helpful and I can't post the hexdump of the binary because of the limit on the number of characters. I can tell, though, that it begins with a MZP – omtinez Jun 30 '11 at 20:40
@omtinez: could you post the name of the file and program and the language (e.g. English) of it? I used xxd -r file > testfile to reconstruct the file from the hexdump (and verified the dump with xxd testfile), but unfortunately file testfile still says "data". Not really useful. – Lekensteyn Jun 30 '11 at 20:45

file can identify many file types by examining the file contents. Usage:

file filename

I tried to reconstruct a part of your file from the data you provided, by using:

printf '\xfe\x1F(\0SR\x89\0\0\6\0\0\0Z\0\0\0XXX.Bin 6\x12XXX.BankName s80\x12XXX.CardType1' > testfile

Unfortunately, file testfile does not give any (useful) results:

testfile: data

You might have more luck by using file on the whole file.

Programs have often an own format for storing data which is optimized for its tasks. If you cannot find the files format, try Google. Another useful tool for extracting information is the strings program, which can be run with strings filename.

share|improve this answer
This is an excellent suggestion (+1). – Randolf Richardson Jun 30 '11 at 20:37
I don't know how I didn't think of this before! Unfortunately, it also returns data on the entire file – omtinez Jun 30 '11 at 20:42
I did think of running strings, but it didn't return anything that could make sense – omtinez Jun 30 '11 at 20:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .