in reply to join two lines in a file?
use warnings; use strict; my @records; $/ = ';'; while (<DATA>) { chomp; s/\s*(?<!^)\n\s*/ /mg; push @records, $_; } print join "\n", @records; __DATA__ 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
Prints:
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
which may provide a useful starting point.
|
|---|