![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| filtering the logs | prvnrk | Shell Programming and Scripting | 5 | 04-08-2008 06:57 PM |
| awk and sed filtering | invinzin21 | Shell Programming and Scripting | 2 | 01-10-2008 11:56 PM |
| Filtering Data | bobo | UNIX for Dummies Questions & Answers | 2 | 09-19-2007 12:06 PM |
| awk filtering ? | varungupta | UNIX for Advanced & Expert Users | 4 | 09-16-2007 11:55 PM |
| Filtering out data ... | videsh77 | UNIX for Dummies Questions & Answers | 1 | 12-29-2004 12:59 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Filtering Data
Hi All,
I have the below input and expected ouput. I need a code which can scan through this input file and if the number in column1 is more than 1 , it will print out the whole line, else it will output "No Re-occurrence". Can anybody help ? Input: 1 vvvvv 20 7 7 23 0 64 6 zzzzzz 11 5 5 13 0 1 1 uuuuu 17 0 0 24 0 146 5 qqqqq 7 3 3 11 0 199 1 ggggg 11 5 5 13 0 13 1 yyyyy 13 7 7 31 0 252 Expected Output: 6 zzzzzz 11 5 5 13 0 1 5 qqqqq 7 3 3 11 0 199 |
| Forum Sponsor | ||
|
|
|
|||
|
Hi Ghostdog,
I only want the the below to surface column1 more than 1. 6 zzzzzz 11 5 5 13 0 1 5 qqqqq 7 3 3 11 0 199 If column1 does not contain 1 then output "No occurence" eg Input: 1 vvvvv 20 7 7 23 0 64 1 uuuuu 17 0 0 24 0 146 1 ggggg 11 5 5 13 0 13 1 yyyyy 13 7 7 31 0 252 Output: No occurrence |
|
|||
|
Thnks Jean it works!!
However, how can i modify the code such that when 2 or more terms are repeated consecutively, it will output the the repeating term, else echo "No consecutive repeating term ? Input: vvvvv 20 7 7 23 0 64 uuuuu 17 0 0 24 0 146 uuuuu 17 0 0 24 0 146 uuuuu 17 0 0 24 0 146 ggggg 11 5 5 13 0 13 yyyyy 13 7 7 31 0 252 ggggg 11 5 5 13 0 13 Expected Output: Consecutive Repeating term = uuuuu 17 0 0 24 0 146 Last edited by Raynon; 09-04-2007 at 10:56 PM. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|