I have a 1gb file and would like to get the third and fifth fields.

The file is delimited by (,):

input file:

luis, jose, jesus atoche, mark, john
aa 1, bb 2, cc3, dd 4, ee5

output file:

jesus atoche, john
  cc3, ee5

I understand that it can be done with the awk commands.


2 Answers 2


Something in the lines of

awk 'BEGIN{FS=","; OFS=","} {print $3, $5}' input_file.csv > output_file.csv

Should work


Try awk -F"," '{print $3","$5}' <input file name>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.