At first what I need to do: I need to input a text file into a database.
That not very hard, but the text file they gave me is kinda strange.
I modified it so that it looks good in the Database, but they don't want to change every file by hand all the time. So I thought why am I not splitting the text file into separate text files or in arrays and upload those bit o where it should belong in the database.
But after searching a long time in the internet I couldn't find anything on how to do (or maybe I found something but I didn't get it :p).
So my question is:
What is the best way to split a text file so that i can upload the chunks in the database? Would it be the best to split it up in a lot of text files and upload every text file or do it in a array and upload those arrays into the database.
The text file it self is divided text and numbers and they only want the numbers to be uploaded into the database and the text in it are the column names of the database.
Here is an example of such a text file (normally without those spaces between it):
UsindsVorigeCall =
-1.0000;0.0000;0.0000;0.0000;
WeerSindsVorigeCall =
-1.0000;10.1000;7.5200;10.4000;
0.0000;10.4000;7.6740;10.7000;
KlimaatSindsVorigeCall =
-1.0000;7.4000;8.8000;6.6000;-99.0000;-99.0000;-99.0000;-99.0000;-99.0000;-99.0000;
0.0000;7.4000;8.9000;6.7000;-99.0000;-99.0000;-99.0000;-99.0000;-99.0000;-99.0000;
KlimaatCompuSettings =
8.0000
21.0000
0.0000
0.0000
-4.0000
2.0000
5.0000
0.0000
4.0000
30.0000
0.4000
-99.0000
-99.0000
-99.0000
-99.0000
-99.0000
-99.0000
-99.0000
-99.0000
-99.0000
If there is also an other option I would be open to it and try it out.
This is the output that I would like to have:http://nl.tinypic.com/view.php?pic=30ue5pd&s=8 (this is with a self edited text file)
Use the BLOB type instead of TEXT, it allows you to write whatever you want.
But I don't approve the fact of writing files in db, it's not made for that: these are relational databases, not garbage.
You should write files directly on filesystem, in a specific folder, and use the database to list the paths and store the data used for the research queries.