![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert two column data into 8 columns | NickC | Shell Programming and Scripting | 8 | 06-28-2008 08:19 AM |
| Count first column on the basis of two other columns | kaustubh137 | Shell Programming and Scripting | 1 | 05-29-2008 05:54 AM |
| How to check Null values in a file column by column if columns are Not NULLs | Mandab | Shell Programming and Scripting | 7 | 03-15-2008 06:57 AM |
| single column to multiple columns | agibbs | UNIX for Dummies Questions & Answers | 7 | 12-05-2007 07:04 PM |
| Sorting based on columns | MobileUser | Shell Programming and Scripting | 7 | 04-11-2007 11:03 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Grep all the columns based on a particular column
This is the data file that I have
21879, 0, 22, 58, 388 0, -1, 300, 1219172589765, 1708, 0, 200, 21891, 0, 0, 33, 309 0, -1, 300, 1219172591478, 1768, 0, 200, 22505, 0, 0, 33, 339 0, -1, 300, 1219172593251, 1738, 0, 200, 21888, 0, 1, 33, 308 0, -1, 300, 1219172594995, 633, 0, 200, 24878, 0, 0, 33, 272 0, -1, 300, 1219172595631, 568, 0, 200, 22371, 0, 0, 34, 269 0, -1, 300, 1219172596204, 569, 0, 200, 26014, 0, 2, 35, 272 0, -1, 300, 1219172596777, 517, 0, 200, 22377, 0, 0, 33, 287 I need to grep all the columns based on the third column value from the left. For example in this case I want all the columns and the rows based on the value of '300' Could someone tell me how this can be done Thanks Poornima |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
What does "all the columns and the rows based on the value of '300'" mean?
Code:
awk -F , '$3 == 300' file |
|
#3
|
|||
|
|||
|
awk -F "," '($3 == 300) {print $0}' filename
|
|||
| Google The UNIX and Linux Forums |