4 ms·
Bash is actually pretty decent at this by itself if you don't have a lot of extra columns: cat somefile.txt | while IFS=" " read one two; do echo -e "$one\
by flukus 7y ago
Bash is actually pretty decent at this by itself if you don't have a lot of extra columns:
cat somefile.txt | while IFS=" " read one two; do echo -e "$one\t$two"; done
IME the pattern matching is where awk really shines.
- 52-6F-62 7y agoI do have a ton of extra columns I'm filtering out but that's really good. I'll try it on. Thanks!
- rmilk 7y agoAlso see basic Unix utilities like cut / paste (and colrm if your *nix has it, not sure if MacOS does) as these do the same column selection and printing and support simple options for delimiter and field number selection instead of writing a parser. cut -d’ ‘ -f 1,2 < some file.txt