We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e080ff commit ab49701Copy full SHA for ab49701
1 file changed
GPU/GPUTracking/Definitions/Parameters/csv_to_json.sh
@@ -2,7 +2,13 @@
2
3
[[ -z $1 ]] && { echo "Usage: csv_to_json.sh CSV_FILE"; exit 1; }
4
5
-awk -vFPAT='([^,]*)|(\"([^\"]|\"\")*\")' \
+DELIM=$'\xFF'
6
+sed -E \
7
+ ':loop
8
+ s/^(([^"]*"[^"]*")*[^"]*),/\1'$DELIM'/;
9
+ t loop' \
10
+ $1 | \
11
+awk -F$DELIM \
12
'BEGIN {
13
print "{"
14
} {
@@ -42,5 +48,4 @@ awk -vFPAT='([^,]*)|(\"([^\"]|\"\")*\")' \
42
48
if (paramprinted) print "\n }"
43
49
if (catprinted) print " }"
44
50
print "}"
45
- }' \
46
- $1
51
+ }'
0 commit comments