-1

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
1,2,3,4,5
aa 1, bb 2, cc3, dd 4, ee5

output file:

jesus atoche, john
3.5
  cc3, ee5

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

THANKS!

0

Something in the lines of

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

Should work

0

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.