csv to mysql table

When i first wanted to apply the LOAD DATA INFILE, my server said:

So i asked the server where i may put the import file:

I put the csv file to import in the directory my server asked me to.

My csv looked like this:  (Tab delimited, 10 columns, last one was not reliably there.)

 

To insert i fired the following SQL:

 

The server complained, so i had to edit single lines in a   >1.000.000 lines text file.

sed was my friend:

check lines from …to:

delete line 39203:

add line below 39202:

Thanks for the great sed tutorial:

http://www.yourownlinux.com/2015/04/sed-command-in-linux-delete-lines-from-file.html

 

About ralf

I studied Geology at University Erlangen and got my PhD (bio-nanotechnology) at TU Dresden. In my spare time i program simulations and tinker around with data prediction methods. Frisbee is my favorite sport and i play guitar when my friends and i meet to make some music.
This entry was posted in coding, datacoll and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.