This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# awk CSV to JS Array js file | |
# cat vectors.csv | awk -F\ -f jmhz-csv-to-js-array-awk.awk > vector_array.js | |
# in this case the 1st field is the name and is used as the index | |
# License : GPL v3 | |
BEGIN{ | |
print "var dataset = {"; | |
} | |
{ | |
print "\t\""$1"\": ["; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
for (i=2;i<=NF;i++) { # first field is ignored i starts from 2 | |
min[i] = 9.999999; | |
max[i] = -9.999999; | |
}; | |
} | |
{ | |
for (i=2;i<=NF;i++) { # first field is ignored i starts from 2 | |
if ($2<min[i]) { min[i]=$i; }; | |
if ($2>max[i]) { max[i]=$i; }; |