mysql - Text import error -
good day
i have created bat file import text file mysql database , looks follows:
sqlcmd /user root /pass password /db "mydb" /command "load data local infile 'file.csv' table tg_orders fields terminated ',' enclosed '"' lines terminated '\n'"
my problem cannot "treat consecutive delimiters one" work...
how add that?
now have got real crux of problem, not consecutive delimiter problem - it's csv file format problem.
if csv file contains fields b121,535
, not enclosed within quote marks of kind and delimeter ,
no amount of sql jiggery-pokery sort out problem. un-quoted fields commas always interpreted 2 separate fields unless enclosed within quote marks.
post sample line csv file causing problems , can diagnose further. failing that, export data initial system again making sure formatting correct (either enclose in speech marks or string fields)
finally, sure database mysql based , not microsoft sql? references sqlcmd.exe
can find point microsoft sites in relation sql server express but, then, has different option structure (-u
user rather /user
). if case have saved lot of hassle putting correct information tags. if not sqlcmd.exe
custom written application somewhere , problem stem that. if case can't if csv formatting correct - you're on own
Comments
Post a Comment