saty has asked for the wisdom of the Perl Monks concerning the following question:
The target I am trying to scan for data is given below (just a dew lines as the file is too big)#!/usr/local/bin/perl -w # analyse_map.perl # Generate a snapshot of audio registers using register log file, # Open map files (map_merc and rom.dld) open(MAP, "<map_merc") || die "Unable to open map_merc"; # Read map_merc : while(<MAP>) { if( ($titi, $toto) = /^\.(\w+).+$\^\t+\.\w+\W+(\w+)/m) { print($titi, $toto, " ", $., "\n"); } } close(MAP);
The thing I am trying to do is scan the line that begins with "." eg .begin etc and put it in the scalar $titi and then if there is a line just below which starts with a tab and then ".", get the second part which is the address. I hope this explaination is clear enough. If you need more explaination mail me at satyajeet.navalkar@philips.com Thanx. Satyoutput input virtual section section address size file .begin 00002000 00000068 .begin a0000000 00000068 begin_flash.o _START a0000000 00000000 .copy_flash 00000000 00001488 .copy_flash a0001000 000001ac libbsp_qt1_aspic32.a[copy +_flash.o] copy_from_flash a0001000 00000000 .copy_flash a00011ac 00000978 libbsp_qt1_aspic32.a[cach +3940.o] SysDisableDCache a00011ac 00000000 disableD a0001220 00000000 SysDisableICache a0001294 00000000 disableI a0001308 00000000 SysEnableDCache a000137c 00000000 enableD a00013f8 00000000 SysEnableICache a0001464 00000000 .text 00003000 00052be4 .boot 80003000 0000009c libbsp_qt1_aspic32.a[boot +.o] HdwInit 80003000 00000000 end_SIF 80003080 00000000 .endtext 80055be4 00000000 .endtext 80055be4 00000000 end.o TextEnd 80055be4 00000000 .data 00180000 000004d0 .data 80201000 00000000 begin_flash.o StartData 80201000 00000000
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Multi-line regex
by Corion (Patriarch) on Aug 28, 2000 at 12:32 UTC | |
|
Re: Multi-line regex
by merlyn (Sage) on Aug 28, 2000 at 14:40 UTC |