Hack Forums
[PHP] 1900 text files, need to import into db - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] 1900 text files, need to import into db (/showthread.php?tid=6048066)



1900 text files, need to import into db - DivineProgramming - Feb 9, 2020

Title pretty much says it all.

I have about 1900 .txt files ranging from 120.0000 to 2 million lines each. They all say the same thing about a game character, but the structure is different.

Example: they all contain ID, playername, player item a to z and experience

But for somehow in a different order.

Any ideas?


RE: 1900 text files, need to import into db - Charger - Feb 9, 2020

Split the files into smaller sizes first off.


RE: 1900 text files, need to import into db - c00lkid66 - Feb 12, 2020

I can help, but you need to post a few lines of each.


RE: 1900 text files, need to import into db - DivineProgramming - Feb 12, 2020

(Feb 12, 2020 01:14 PM)c00lkid66 Wrote:  I can help, but you need to post a few lines of each.

Hey, i am on windows if that makes a difference.

The mysql database is a remote connection.

If you could help me with just email:password then that would save a lot of time. I could just upload the gamedatafiles manually.


RE: 1900 text files, need to import into db - Backbone - Feb 14, 2020

Do you have API's for that, or just a bare mysql connection?


RE: 1900 text files, need to import into db - Jam1e - Feb 15, 2020

(Feb 9, 2020 01:49 PM)DivineProgramming Wrote:  Title pretty much says it all.

I have about 1900 .txt files ranging from 120.0000 to 2 million lines each. They all say the same thing about a game character, but the structure is different.

Example: they all contain ID, playername, player item a to z and experience

But for somehow in a different order.

Any ideas?

Would you be able to provide a little more information, please?
For example, can we see a couple of the different structures that you mention?


RE: 1900 text files, need to import into db - DivineProgramming - Feb 15, 2020

I wrote a python script for this. Thanks for the tips thougj