On Nov 21, 2007 11:28 AM, avinashsuratkal <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the following log and my requirement is to capture the block
> from one "-->" symbol to another. and put it in other file, using
> perl.
>
> ---------------------------------
> --> Checking Server Hostname <--
> ---------------------------------
> Server Hostname: xxxxxxxxx
> ---------------------------------------
> --> Checking Authentication Domain <--
> ---------------------------------------
> Server is authenticating against: xxxxxxxxx
>
> --------------------------------------
> --> Validating DNS Server Entries <--
> --------------------------------------
> Servers should conform to global ANYCast Standard
>
> Thanks
> Avinash
You mean you want to turn the above input into somthing like this?
-------------------------------------
Checking Server Hostname
Checking Authentication Domain
Validating DNS Server Entries
-------------------------------------
$ perl -e 'while(<>){print "$1\n" if /-->(.*)<--/; }' inputFile > outputFile
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/