|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
awk check for equal - help
Input file: Code:
x A 10 y A 10 z A 10 x B 10 y B 12 z B 10 x C 0 y C 0 Required output: Code:
x B 10 y B 12 z B 10 i.e. printing only that section (based on 2nd field) for which third field($3) is not equal for all the lines for that 2nd field. Please help |
| Sponsored Links | ||
|
|
|
||||
|
It's easy to produce the desired ouput but I didn't understand your explanaton. Quote:
![]() If so... Code:
grep " B " infile| uniq |
|
|||
|
Thanks Zaxxon and vgersh99 for the reply. I want to only print the section for which 3rd field is different (one section is basically based on second field, here A,B and C ). Code:
x A 10 y A 10 z A 10 x B 10 y B 12 z B 10 x C 0 y C 0 |
|
|||
|
To: UnWork72
The replies you have been recived are really for that you have actually asked??? coz i feel you are not specific about "B" in column 2, i mean $2 What i feel is it depends on column 2 but you have to find unmatched in column 3, m i rite??? if yes.... can we work out n discuss |
|
|||
|
Code:
x B 10 y B 12 z B 10 for A, all the third fields are same (10), same for C(0), but for B the 3rd fields are not same, so I wanted to print B section. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| while loop not taking the not equal to condition | ssuresh1999 | UNIX for Dummies Questions & Answers | 9 | 08-12-2008 10:05 AM |
| Edit entry if not equal | kenshinhimura | Shell Programming and Scripting | 4 | 08-07-2008 12:18 AM |
| Stop+A equal | tlee | Solaris | 5 | 07-01-2008 07:42 AM |
| add not equal in script. | myguess21 | Shell Programming and Scripting | 2 | 02-26-2008 10:20 AM |
| Making a variable equal a pattern | Bab00shka | UNIX for Dummies Questions & Answers | 3 | 03-08-2004 06:46 AM |