How do get the first column of every line in an input CSV file and output to a new file? I am thinking using awk but not sure how.
awk
Try this:
awk -F"," '{print $1}' data.txt
It will split each input line in the file data.txt into different fields based on , character (as specified with the -F) and print the first field (column) to stdout.
data.txt
,
-F
1.4m articles
1.4m replys
5 comments
57.0k users