![]() |
Extracting columns
Hi,
How can I extract 5th column from a file without the header. Please help me.... Thank you |
For simple extraction you can usually use cut, and for more complex jobs you'd probably want to use awk.
Please give us a real-life example of the file contents, along with how you want the output to look, if you want any detailed advice. |
Quote:
Code:
cat sarout I'll use Code:
cat sarout | awk '{print $5}' Code:
cat sarout | awk '{print $5}' | grep -E "[0-9]\.[0-9]{2}" |
Well, sure, I could've just posted something like that. ;) But I think it's important for posters to learn how to define their questions clearly and with enough detail up-front. I don't enjoy having to guess about the poster's situation or asking a lot of fishing questions.
I also like to encourage them to do their own research, which is why I mentioned which tools are most likely to be useful. In short, vague questions generally get vague answers. Detailed posts are more likely to draw out helpful responses, and get them faster. :twocents: |
Quote:
Code:
awk 'NR>1{print $5}' sarout |
Thank you guys. That sloved my problem. I'll be more specific next time.
Thanks again |
All times are GMT -5. The time now is 06:35 AM. |