Ubuntu – view the column names for CSV file

command linecsvtext processing

i have a CSV file i want to get the columns name for each column

sample :

image

how can i do that with awk or sed or grep ??

Best Answer

head -n 1 file.csv

or

sed 1q file.csv

or

grep -m 1 '' file.csv

or

awk 'NR==1 {print; exit}' file.csv
Related Question