What is the best way to prepare the log files before inserting their values in the MYSQL database using
LOAD DATA INFILE ‘/tmp/someFile.txt’
INTO TABLE
How can I make sure and make the data log file ready to be read by such command ? Someone told me by scripting (using sed,grep,cat,sub …) .. how can I do that or what are the tools ?
I know how to place the file so MySQL can read it, but I want to know how to organize it and prepare its content for that.
You can use excel to setup your csv file correctly, or even calc from openoffice.
Do you not have access to phpMyAdmin? This will make your job a little easier. Also try searching Google for “mysql import csv”. That should give you some information on how to layout your file.
Remembering from when I did this using phpMyAdmin, you could have your data in 1 of 2 ways depending on your import settings.
Your csv for this would look like:
OR
I hope that helps.