For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > November 2006 > search replace and retain remaining line and comparison









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author search replace and retain remaining line and comparison
IJALAB

2006-11-21, 7:57 am

I have lines like:

$PSTIL,IRQ, 48 bytes
9,9,IDLE,0,0,CC,0,0,MC,1,1,NF,2,2,CD,2,0
,AI,1,1,LP,81,83*09

$PSTIL,IRQ,9,9,IDLE,0,0,CC,0,0,MC,1,1,NF
,2,2,CD,2,0,AI,1,1,LP,81,83*09

$PSTIL,IRQ,9,37 bytes
9,IDLE,0,0,CC,0,0,MC,1,1,NF,2,2,CD,2,0,A
I,1,1,LP,81,83*09

I need to remove these 37 and 48 bytes text from these lines and print
the remaining string to another file. Also I need to check for any
newline characters in the end of every line.

Finally I need to compare each of these line with another file that
also has a similar output and report if any discrepancy exists.

Can anyone help in this.

Thanks,
Bala

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com