in reply to join two lines in a file?
printsmy @array = <DATA>; chomp; for my $array (@array){ $array =~ s/\n$// if ($array !~ /;[^;]*;/) && ($array =~ /^\w/); $array =~ s/^\s*([^\s])/$1/; } print @array; __DATA__ The Road Ahead1;Completely Revised and Up-to-Date; 002564418 road ahead2; America?~@~Ya creeping revolution;00345678 The road ahead3;[Address made before the Regional Foreign Policy Conference; 004561963
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 Confe +rence; 004561963
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: join two lines in a file?
by happyrainb (Novice) on Jan 17, 2008 at 01:37 UTC |