-1
I have txt file
text1|text2|text3|text4,
text1|text2|text3|text4,
text1|text2|text3|text4,
text1|text2|text3|text4,
text1|text2|text3|text4,

 ("LOAD DATA  INFILE '1.txt' INTO TABLE `main`
                    FIELDS TERMINATED BY '|'
                    LINES TERMINATED BY ','
                    ");

main table view is id value1 value2 value3 value4

everything works ok

i need to ignore first column (id) !!

How to change mysql query to insert

text1 to value1
text2 to value2
text3 to value3

etc..

1 Answers1

0

Use IGNORE, like this:

LOAD DATA INFILE '/tmp/test.txt' INTO TABLE test IGNORE 1 LINES;
Jim Archer
  • 1,109
  • 2
  • 22
  • 40