in reply to Printing columns to a single file

I need 21 and 4 column of every file ... print $F[0], $F[4]

Which is it: 21st and 4th columns, or first and fifth columns?

I have many files ...I used this command but its printing in single files...

The command you show processes a single input file and produces a single output file. Do you know about wild cards?

my out put should have all the columns printed with headers of files name..

What bit of the command you've shown do you expect to produce "headers of files name."?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Printing columns to a single file
by Anonymous Monk on Mar 05, 2014 at 15:55 UTC

    Hi I would löike to extract column 0 and 4 of every file and print them in a single file ex: Gene Id fEMALE mALE 00121 251 252 2213 3 224 .... GENE ID IS COMMON IN EVERY FILE i dont mine using long script but when i tried my code has errors

      but when i tried my code has errors

      Show us your failing code and let us help you correct your errors.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
A reply falls below the community's threshold of quality. You may see it by logging in.