![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl Pattern Matching | nmattam | Shell Programming and Scripting | 2 | 09-28-2009 07:17 AM |
| Perl -Pattern Matching help..! | coolbhai | Shell Programming and Scripting | 5 | 03-11-2009 01:15 PM |
| Perl Pattern Matching !!! Help | maxmave | Shell Programming and Scripting | 0 | 06-03-2008 08:05 PM |
| perl pattern matching | zedex | Shell Programming and Scripting | 2 | 09-30-2007 09:29 AM |
| perl pattern matching vs. grep | junkmail426 | Shell Programming and Scripting | 0 | 09-28-2005 11:40 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Perl pattern matching!!
Hi experts,
I have many occurances of the following headers in a file. I need to grep for the word changed/inserted in the header, calculate the difference between the two numbers and list the count incrementally. Headers in a file look like this: ----------[changed to 229-232]--------- -----------[inserted 294-296]---------- ------------[changed to 861]----------- I should grep for the word changed, also grep the numbers listed 229 and 232 and find their difference. The difference in the number of lines is the output. Similarly grep for inserted and the difference in the numbers. If the header contains just one number increment by one. Output should be like: Number of lines changed :4 (here 3 from first header and one from last header matching the word changed) Number of lines inserted :2 Please help me, i am held up with this for long. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|