Commit d7ffb595 authored by Alex Segers's avatar Alex Segers

1. Generate SQL

parent 24d6d0b8
#!/bin/bash
SAMPLE_TXT="../input/sample.txt"
while read -r ROW || [ -n "$ROW" ];
do
CODE=$(echo $ROW | awk -F, '{ print $1 }')
NAME=$(echo $ROW | awk -F, '{ print $2 }')
COLOR=$(echo $ROW | awk -F, '{ print $3 }')
echo "insert into myfruits (code, name, color) values ($CODE,\"$NAME\",\"$COLOR\")"
done < $SAMPLE_TXT
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment