On Tuesday 29 June 2004 17:04, mohammed chafik wrote: > header, 06-12-2004, path, > /usr/bin/sh,attribute,100555,tom,other,315,56,11,54,77,10,88, > subject,bscs,sgrp,9936,6785,0 0,return,success,0 (line3) > ----------------------------------------------------------------------- > > I need to generate an output file like this (deleting fields between > attribute and subject, please note that number of those fields is > variable): > --------------------------------------------------------------------------- >-------- header, 06-12-2004, path, /usr/bin/sh, > subject,bscs,sgrp,9936,6785,0 0,return,success,0 (line1)
I'd use a regular expression to pull out the parts before "attribute" and after "subject" (maybe including it, depends on what you want) and just concatenate them together. Take a look at perldoc perlre If you need help with the regex, let us know. HTH, Philipp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>