X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=generator.sh;h=1a5258a33ff5b00898ce2ec5ad0b0d3dcbae7471;hb=62cab6706e49731d960145f8130ee4275b189a6d;hp=6ca6930a2232a6c605febe57b0ad9f1070429d5d;hpb=204557036bf489cf2ce0e0815aea65a10e73fa7b;p=ink-generator.git diff --git a/generator.sh b/generator.sh index 6ca6930..1a5258a 100755 --- a/generator.sh +++ b/generator.sh @@ -52,11 +52,6 @@ Please, give the right name, or give the full path for the CSV file." exit 1 fi -#function sep_line { -# sed 's/^\([^"]*\("[^"]*"[^"]*\)*"[^"]*\),/\1#COMMAHACK#/g' | -# sed 's/,/\n/g' | sed "s/\"\"/\"/g; s/^['\"]\|['\"]$//g" -#} - function csv_split() { ## USAGE: csv_split CSV_RECORD local record=${1%"${CR}"} local right @@ -88,7 +83,7 @@ function csv_split() { ## USAGE: csv_split CSV_RECORD done - echo $record + echo ${record%\"} } # Set column names: @@ -216,11 +211,11 @@ cat "$data_file" | ( let col++ echo -n "s/%VAR_${col_name[$col]}%/$( echo "$val" | sed "s/\//\\\\\//g; s/'/\´/g" - )/g; " | sed 's/#COMMAHACK#/,/g' + )/g; " if [ "${extracol[$col]}" != "" ]; then echo -n "s/${extracol[$col]}/$( echo "$val" | sed "s/\//\\\\\//g; s/'/\´/g" - )/g; " | sed 's/#COMMAHACK#/,/g' + )/g; " fi done )"