brobert Posted November 1, 2012 Share Posted November 1, 2012 Hi all. I`m new to this forum, please excuse me if I ask somethin stupid. I have a problem with a datafile, which contains data in the following format: 000000001 LDR L -----nam0-22------u-450- 000000001 001 L $$a0000001 000000001 100 L $$a--------d--------km-y0rumy0103----ba 000000001 1010 L $$atest 000000002 LDR L -----nam0-22------u-450- 000000002 001 L $$a0000002 000000002 100 L $$a--------d--------km-y0rumy0103----ba 000000002 2001 L $$aUtcák, terek, emberek$$eZalaegerszeg$$dStreets, Squares and People # Strassen, Pl„tzen, Menschen$$eZalaegerszeg in Old Pictures, Zalaegerszeg auf alten Bildern 000000002 314 L $$aMegyeri Do you thing its possible to convert it into a format that could be inserted into a MySQL database? The datafile could be converted to CSV first. I would need to keep the number 0000001, the fieldnumber (for ex. 100) and the data it contains. The final product will need to be an xml file, but if they are inserted into a db, it could be easily extracted into an xml file. Do you think its possible? Any ideas? Thank you very much for any comments! Quote Link to comment https://forums.phpfreaks.com/topic/270153-convert-data-and-instert-into-mysql/ Share on other sites More sharing options...
Muddy_Funster Posted November 1, 2012 Share Posted November 1, 2012 possible, yes, could you attach a small sample of the actual raw data file? Quote Link to comment https://forums.phpfreaks.com/topic/270153-convert-data-and-instert-into-mysql/#findComment-1389257 Share on other sites More sharing options...
cyberRobot Posted November 1, 2012 Share Posted November 1, 2012 You could look into using explode() to break apart the data for processing: http://php.net/manua...ion.explode.php Quote Link to comment https://forums.phpfreaks.com/topic/270153-convert-data-and-instert-into-mysql/#findComment-1389266 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.