0

I am importing some thousands lines of Data from a .txt file containing two columns and the format is as it follows:

A8041550408#=86^:|blablablablablablablablablablablablablablablablablablablabla1

blablablablablablablablablablablablablablablablablablablabla2

blablablablablablablablablablablablablablablablablablablabla3

A8041550408#=86^:|blablablablablablablablablablablablablablablablablablablabla1

blablablablablablablablablablablablablablablablablablablabla2
A8041550408#=86^:|blablablablablablablablablablablablablablablablablablablabla1

blablablablablablablablablablablablablablablablablablablabla2

blablablablablablablablablablablablablablablablablablablabla3

blablablablablablablablablablablablablablablablablablablabla4
etc....

What I have done so far is create a table with the two fields, but when i try to import the .txt file as a CSV and putting / Columns separated By : | /, I get an error:

"Invalid column count in CSV input on line 2."

Which is quite obvious since the second line of the .txt file is empty.

Moreover, I have tried importing the file as a CSV using LOAD DATA, and it didn't work as well it has just filled up the table with random words and phrases from the .txt file . So my question is : How can I import the data from this file ?

MasterCX
  • 13
  • 4

1 Answers1

1

You have to fix your file; in its current state you cannot expect the import module to be able to understand it. First step would be to remove the empty lines: How to remove blank lines from a Unix file

Community
  • 1
  • 1
Marc Delisle
  • 8,879
  • 3
  • 29
  • 29