Demonstrate how to parse and work with CSV files
TODO:
- Fix the empty string handling
- Validate data being piped
- tidy viewer - https://github.com/alexhallam/tv
NOTES:
- Use
mechatroner.rainbow-csv
in vscode. You can also use it to align fields.
Show how to read a csv file and loop over it row by row.
./parse_csv.sh
An example script to take a csv data piped in and convert it into a json document.
# simple example using jq to create a json doc
cat ./test.map | ./csv2json.sh
Convert a TSV to CSV
tr '\t' ',' < ./file.tsv > ./file.csv
cut -d',' -f4- ./out/mydata.csv > ./out/mydata_3_less_columns.csv