logger wrote:
> Hi All
> I have an entry like this in a file which I want to parse
> #comments1
> DNFAR1S query tli tcp /dev/tcp \x00020bb8a9f3702f0000000000000000
> #comments2
> PKG1S query tli tcp /dev/tcp \x000205c8a9f3702f0000000000000000
> and put into another file as different variables like
> #comments
> V1=DNFAR1S
> V2=query
> v3=tcp
> v4=/dev/tcp
> v5=0002
> v6=3000 // dec of 0bb8
> v7=169.43.112.47 // (a9f3702f converted to decimal )
> #comments2
> V1=
> .
> .
> v6=
> How do I match this pattern repeatedly so that I can create another file 
> like this
> which also reproduces the comments

I don't really understand the problem.  If you iterate over the file
line by line, you can copy each comment to the output file and modify
the other lines into several lines when you encounter them.   Seems
simple enough.  Pseudo code:

open IN ,,,
open OUT ...
while (<IN>) {
        if comment
                print to out
        else
                breakdown line into fields
                foreach field
                        write field to OUT
                endfor
        endif
}

Maybe there's something I don't get ?

-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to