The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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 Repetitive Pattern Matching Niroj Shell Programming and Scripting 2 08-05-2009 10: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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-28-2009
nmattam nmattam is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 13
Perl Pattern Matching

Hello experts,

I have a file containing the following text(shortened here).

Code:
File Begin
 
-----[31-32 changed to 31-32]-----
< # Billboard.d3fc1302a677.imagePath=S:\\efcm_T4
< Billboard.d3fc1302a677.imagePath=S:\\efcm_T4
---
> # Billboard.d3fc1302a677.imagePath=S:\\efcm_Cassini
> Billboard.d3fc1302a677.imagePath=S:\\efcm_Cassini
 
-----[after 248 inserted 249-266]-----
> 
> # ShowDialogAction.4aa6f5a0a2a1.buttonLabel=OK
> ShowDialogAction.4aa6f5a0a2a1.buttonLabel=OK
> 
> # ShowDialogAction.4aa6f5a0a2a1.cancelButtonLabel=Cancel
> ShowDialogAction.4aa6f5a0a2a1.cancelButtonLabel=Cancel
> 
 
File End

I now need to write a perl script to grep for the header containing 'changed' (here : -----[31-32 changed to 31-32]-----),
and count all the lines only having '>' symbol.
For example: Here i grep for the word 'changed' from the first header and count the lines containing '>'. So the count must be 2.
Similarly for the second match 'inserted', the number of lines will result in 7 with '>' symbol.
Please help me....Thanks in advance.

Last edited by Franklin52; 09-28-2009 at 08:17 AM.. Reason: Please use code tags!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0