I need help, I am trying to pretty much convert a text file to a CSV file so I can import it into MySQL. And would also like to have a date added to every line.
The data that I am working with like this.
0.405 19417.379 346.651 51394.910
0.905 19417.320 346.544 51394.848
1.405 19417.367 346.576 51394.891
1.905 19417.355 346.597 51394.910
2.405 19417.367 346.533 51394.867
2.905 19417.447 346.629 51394.910
3.405 19417.436 346.651 51394.805
3.905 19417.389 346.640 51394.738
4.405 19417.400 346.587 51394.812
It needs to be formatted a little like this, and have the Data's data inserted in the front.
<date>,0.405,19417.379,346.651 51394.910
<date>,0.905,19417.320,346.544 51394.848
<date>,1.405,19417.367,346.576 51394.891
<date>,1.905,19417.355,346.597 51394.910
<date>,2.405,19417.367,346.533 51394.867
<date>,2.905,19417.447,346.629 51394.910
<date>,3.405,19417.436,346.651 51394.805
<date>,3.905,19417.389,346.640 51394.738
<date>,4.405,19417.400,346.587 51394.812
I and pretty new to PHP but have been able to write a PHP script that will do all the data processing I need on the data but, I need a better way of importing the data in to MySQL.
I have been using excel 2007 with the text to column function, To do what is needed on this.
The reason I am needed a way to automate this, is the fact that I have about 3-4GB of plain text that needs to formatted and imported in a DB.
Thanks for reading and hope you can help.
