When using the load utility on a CSV file, it seems I always need to
edit the input file and add an extra comma after the last field in
order for MySql to parse the line properly.
I use a command like:
LOAD DATA INFILE 'absolute path to file.csv'
IGNORE
INTO TABLE table-name
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED
BY '\n' ;
for an input file created on a Linux system and I always have to add
the extra comma to the end of each record in order to get the records
loaded correctly.
Does anyone have some experience with this and can provide some
suggestion?
Also, is it possible to use the mative MySql load utility to load a
fixed-format input file? From everything I am reading it seems you
have to use some other language like perl or python or php, etc in
order to load a fixed-format file.
Any help is welcome.
Thanks
edit the input file and add an extra comma after the last field in
order for MySql to parse the line properly.
I use a command like:
LOAD DATA INFILE 'absolute path to file.csv'
IGNORE
INTO TABLE table-name
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED
BY '\n' ;
for an input file created on a Linux system and I always have to add
the extra comma to the end of each record in order to get the records
loaded correctly.
Does anyone have some experience with this and can provide some
suggestion?
Also, is it possible to use the mative MySql load utility to load a
fixed-format input file? From everything I am reading it seems you
have to use some other language like perl or python or php, etc in
order to load a fixed-format file.
Any help is welcome.
Thanks
Comment