happyrainb has asked for the wisdom of the Perl Monks concerning the following question:
The Road Ahead1;Completely Revised and Up-to-Date; 002564418 road ahead2; America’a creeping revolution;00345678 The road ahead3;[Address made before the Regional Foreign Policy Conference; 004561963 my Perl codes read each line in an array, but how can I join only the +two lines of the Description? ============================================ open IN,"In.txt" or die "Can't read \n"; my @array=<IN>; chomp; for my $array (@array){ $array=~s/^\s*$//; my @field=split(/";"/, $array); for my $field (@field){ ..... } } close IN;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: join two lines in a file?
by olus (Curate) on Jan 17, 2008 at 01:32 UTC | |
by happyrainb (Novice) on Jan 17, 2008 at 01:37 UTC | |
|
Re: join two lines in a file?
by GrandFather (Saint) on Jan 17, 2008 at 01:28 UTC | |
|
Re: join two lines in a file?
by ambrus (Abbot) on Jan 17, 2008 at 09:23 UTC | |
by happyrainb (Novice) on Jan 17, 2008 at 16:18 UTC | |
|
Re: join two lines in a file
by aquarium (Curate) on Jan 17, 2008 at 03:21 UTC |