in reply to Issue splitting in while Loop
If you still have problems, you need to be specific: show us a few lines of the input file, your actual output and your expected output.open RAN, "f03_20859_04aug08RANmri_block2.log" or die "Unable to open file!"; open NEW, ">>Out.txt" or die "Unable to open file for output!"; open AVG, "Avg.txt" or die "Unable to open file for averaging!"; while ( my $text = <RAN> ) { if ( $text =~ /\bResponse\b/ ) { @response = split( /\s/, $text ); print NEW $text, "\n"; } print AVG $response[4]; } close NEW; close RAN; close AVG;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Issue splitting in while Loop
by savem (Initiate) on Jul 29, 2011 at 21:02 UTC |