Project

General

Profile

1 6471 aaronmk
#!/bin/sh
2
# Publishes analytical DB to nimoy
3
4 6651 aaronmk
if ! test -n "$table" -a "$#" -eq 1; then
5 6650 aaronmk
    echo "Usage: env table=... $0 export.csv"|fold -s >&2
6
    exit 2
7
fi
8
9 6491 aaronmk
mysql --password --database=bien3_adb <<EOF
10 6474 aaronmk
LOAD DATA LOCAL INFILE '$1'
11 6650 aaronmk
INTO TABLE $table
12 6474 aaronmk
FIELDS TERMINATED BY ','
13
OPTIONALLY ENCLOSED BY '"'
14
ESCAPED BY '"'
15
IGNORE 1 LINES
16
;
17
EOF