I’ve just downloaded a bunch of text files from data.gov, and there are fields in the text file that I really don’t need.
Is there a way to import columns [1,3] and leave the rest?
I figure I’ll import using ‘load data in file’, but didn’t see anything on the mysql page as to how to only import certain columns.
http://dev.mysql.com/doc/refman/5.0/en/load-data.html
The fields are delimited by ^.
Just so I’m clear, if a line in the txt file is
00111^first column entry^second column entry^this would be the 3rd column
I am trying to get my mysql table to contain
first column entry | this would be the 3rd column
You could always create a table with a dummy column(s) which you drop after loading the file (assuming you don’t have to load the file very often).
Something like this: