Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

<FE>^_(^@SR<89>^@^@^F^@^@^@Z^@^@^@XXX.Bin 6^RXXX.BankName s80^RXXX.CardType1 7^RXXX.CardType2 F^RXXX.Country Q^RXXX.BankPhone Q^R^T^F^D^C^C^X^@400094^R^@^@^@STAR_NETWORKS,_INCN/AN/AUNITED_STATES_OF_AMERICA^F^D^C^C^X^@400109^R^@^@^@EFUNDS_CORPORATIONN/AN/AUNITED_STATES_OF_AMERICA^F^D^C^C^X^@400110^P^@^@^@FIFTH_THIRD_BANKN/AN/AUNITED_STATES_OF_AMERICA^F^D^C^C^X^@

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
1  
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
1  
@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
show 8 more comments

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.