11

Csv to sql script

view full story
linux-howto

http://www.unix.com – I have csv files that has 80-100 columns , I want to convert to sql script files.1st line is field name. Code: awk -F"," 'BEGIN{OFS=","}  {print "INSERT INTO THEL(id,b,c) value("NR,$1,$2")"}' How to make script that detect number of fields so i don't need to edit manually for each files. thanks you (HowTos)