removed COMMAHACK
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Apr 2011 19:52:22 +0000 (21:52 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Apr 2011 19:52:22 +0000 (21:52 +0200)
generator.sh

index 6ca6930..42023d7 100755 (executable)
@@ -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
@@ -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
     )"