Column selection in a text file

Clement44 Posted messages 6 Status Member -  
dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   -
Hello everyone,

I need to process files formed by Linux function redirects. Basically, I have a function, and I redirect the output to a text file. The problem is that the results appear in tabular form and I only need one column of the table.

Are there any commands that could help in the console so that I can redirect only the column(s) I’m interested in? or perhaps a command that would process the target file?

Thanks in advance for any answers or leads you can give.

ps: an example of part of a file I have to process (normally the columns are aligned):

total used free
Mem: 1010 666 343
Swap: 1983 0 1983

Configuration: Windows 2000 Firefox 2.0.0.2

1 answer

dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 659
 
Hello

display the 2nd and 4th columns: awk '{print $2, $4}' fichier
also see cut
2