You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
325 B
16 lines
325 B
#!/bin/sh
|
|
|
|
if [ -z "$csv_file" ]; then
|
|
echo "No file specified" >&2
|
|
exit 1
|
|
fi
|
|
|
|
{
|
|
echo ".separator ,"
|
|
echo ".import $csv_file employee"
|
|
} | sqlite3 megacorp.db
|
|
if [ $? -eq 0 ]; then
|
|
echo "Succesfully loaded employees"
|
|
else
|
|
echo "Failed to load employees. Maybe you should clean the database first?"
|
|
fi
|
|
|