.dat & .bin -> MySQL Converter

11/21/2009 21:46 two_laid#1
Heya!

In the pak files you will find .dat and .bin files containing mostly string data and monster data.. I will now provide you with two tools of mine that can convert these files into MySQL queries..
I used this technique to create an online monster and item database I'm running locally

Download:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Usage:
bin2sql.exe <input file> <output file> [korean columns] [auto-translate]

- input file: The .bin file to read
- output file: The .sql/.txt you wanna write to
- korean columns: This will use Unicode column captions and therefore displays correct korean words
- auto-translate: This option will translate some of the columns into matching english captions, but dont expect too much :) (requires korean columns to be '1')

dat2sql.exe <input file> <output file>

- input file: The .bin file to read
- output file: The .sql/.txt you wanna write to

Have fun!
11/21/2009 21:48 Cholik#2
#pinned
11/24/2009 12:43 Neyoel#3
nice one but one question ..
you call this tool like this:
bin2sql.exe <input file> <output file> [korean columns] [auto-translate]
is there an arg to automatically assign the <input file> arg to <output file> ?
cuz its annoying to write the name of the input file twice xD (i know im a lazy fool :P)

regs


Edit:
just found a possible bug in the Dat converter.. at some files the converter creates the output file, and then crashes with a Windows Error ("Caused a Problem blah") for a simple example the ColorTable.dat causes this error .. i know you can open it with the Editor and there is almost nothing in it, but the converter should convert it instead of crashing .. right? ^^
11/24/2009 15:59 two_laid#4
first of all, no there is no option for that. I myself used a simple batch file to parse every dat bin file ;O

and there a few tables (three or four) that, for some reason, do now work in the normal way.. and thats why my converter will crash on these. I thinks it's colortable and some exptables

thank you for your feedback :)
11/24/2009 16:07 Neyoel#5
ah okay .. mmh but writing a batch file takes some time too =P nah .. anyways think ill just do that too
again, nice tool =)

regs
11/24/2009 19:29 LemoniscooL#6
nett ^^
is ne ziemliche erleichterung =P
11/24/2009 22:28 two_laid#7
Little update!
Fixed a encoding problem with dat2sql and also fixed file generation for inputfiles containing a path (like "path\to\file.dat")
11/25/2009 12:05 LemoniscooL#8
wollt ma anmerken .. die bin2sql.exe hat den selben fehler wie die dat2sql.exe (die, btw ich gefunden hab ;) ).. der fehler mit dem Pfad als Tablenamen mein ich, die codierung stimmt aber ^^

greetz

//Edit:
oh der fehler is auch schon gefixxt kk .. sry hab nichts gesagt ^^
11/25/2009 14:03 Neyoel#9
Thanks for fixing those errors ^^
i was fixing the encoding error with simply re-saving the file in utf8, but now it works without doing that =D

regs,
Neyoel
11/25/2009 15:16 LemoniscooL#10
Hey hatte grad noch ne idee wie wär es it nem arg, das angibt ob die zu beschreibende datei (arg2) überschrieben werden soll, oder ob das was reingeschrieben werden soll einfach an das ende angefügt wird? soweit ich weiss geht das hab mich noch nich viel mitm filestream auseinander gesetzt, aber ich meine mal gelesen zu haben, dass man das iwi auswählen kann ^^

fänd ich gut, dann könnte man nämlich wenn man mehrere files nacheinander konvertieren will alles in eine sql datei schreiben lassen und dann einfach eine sql datei importen statt für jede dat/bin datei eine sql datei ^^ (ich weiss dass man mit tools wie navicat auch alle auf einmal importen kann, aber es gibt eben leute die mögen solche remote programme nich und greifen lieber über nen WebCP drauf zu und bei z.B. phpMyAdmin kann man nich mehrere dateien gleichzeitig importen ^^)

greetz
11/26/2009 14:50 Neyoel#11
Hey there!
Would it be possible that you make two tools that do exactly the same as this two, but reversed? i mean .. Sql2Dat and Sql2Bin? editing the .dat & .bin files would be much more easier then =)

regs,
Neyoel
11/26/2009 15:04 two_laid#12
@emale: i will try to make that in the near future..

@neyoel: interesting idea.. i will look into that
03/08/2011 15:56 noob9875545#13
ehm kann mal jemand erklären worums geht?:D
Kann kein englisch
Kann jemand übersetzen?
03/08/2011 19:08 Blut-Engel#14
Du kannst files mit der endug .bin oder .dat in eine mysql datenbank kopiren. So habs ich verstanden. Und geb mal bei google übersetzer ein, da kannst du alles übersetzen, zwar in schlechtes deutsch aber immerhin :-P
05/28/2011 19:20 elaltavoz#15
I don't understand why when I open .exe, it closes at the moment.