Hacker News new | past | comments | ask | show | jobs | submit login

To be fair, sometimes calling some giant java library or installing tons of dependencies is just not realistic. Use the library for the mission critical stuff or the automated reporting without a doubt, but it's important to be practical and thinking on your feet as well.

In the meantime for quick analysis and testing 90% + can be accomplished with one line of (g)awk.

  awk -v FPAT='"[^"]*"|[^,]*' -v OFS='\t' '{$1=$1; print $0}' "$filename" 
More on FPAT [here](https://www.gnu.org/software/gawk/manual/gawk.html#Splitting...)



You can also use xsv for this kind of analysis of CSV files. Which is a unix-style tool designed for CSVs and with a proper CSV parser.

It's written in Rust so it's one binary - no runtime dependencies, and will happily chunk through multi-gigabyte files.

https://github.com/BurntSushi/xsv




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: