I have a huge file that I need to analyze. What I want to do is separate those rows that have certain values in a certain column. So, its like choosing only those data that belong to a certain category. How can this be accomplished with a simple bash commnand or script.
For example, I want to separate only those rows which have values 1, 2 3 or 4 in the 8th column. The file is space delimited.
You can use awk as:
awk '$8 == 1 || $8 == 2 || $8 == 3 || $8 == 4' file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With