csv - load data infile syntax in mysql -
i using load info local infile command upload big csv file in mysql db. field integer in mysql table , take integer.
now if csv file contains numbers below sql doesn't work.the format of csv file
id "322" "445" "211"
so inserting 0 in table. if csv file contains no double quotes it's fine.
how can tell "load info infile" command ignore double quotes( hard remove double quotes csv file has got 1 1000000 records).my sql is
$insert_query = "load info local infile '".$target_path."' table master_huts ignore 1 lines (hids) ";
try adding this:
fields optionally enclosed '"'
before:
ignore 1 lines
mysql csv load-data-infile
No comments:
Post a Comment