Bash script to load records from CSV file into local MySQL database

#!/bin/bash
# Jovanovic, 2013-01, load from CSV file to croala_lemmadb SQL
# usage: ./csv2croala_db.sh filename (= $1)
 
cmd="LOAD DATA LOCAL INFILE '$1' INTO TABLE croala_lemmadb FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' (forma,lemma,pofs,stem,note);"
# echo ${cmd}
mysql -u philologic -p philologic -e "$cmd"
 
# end of script
 
z/csv2croala_db.sh.txt · Last modified: 20. 01. 2013. 12:28 by njovanov
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki