in reply to Text Processing

@pieces = split(/ /, $tmp); #Split-up the entire line... $newjob = $pieces[0]." "."JF".$pieces[1]." ".$pieces[2]. " ".$pieces[3]."\n"; $temp = $newjob;
Could probably be replaced with...
$tmp =~ s/^([^ ]+\s+)/$1JF/;

Replies are listed 'Best First'.
Re: Re: Text Processing
by Ixandantilus (Initiate) on Apr 21, 2001 at 00:44 UTC
    I need JF to be replaced by a string from the 12th line...
      Well you can still use the expression... Just replace the JF with a var that contains the string you want to put in there. I thought you already had the code to extract the string. Sorry.