in reply to Substitution in range operator
If the file size is not too large you could read in the whole text and replace each instance of a new line followed by a pipe, with a space. Then afterwards go through it again line by line and make your other substitutions.
local $/; open my $fh, '<', 'file.txt' or die $!; my $txt = <$fh>; $txt =~ s/\n\|/ /g; for ( split '\n', $txt ) { # process each line }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Substitution in range operator
by benaw (Novice) on Dec 30, 2015 at 04:48 UTC | |
by 1nickt (Canon) on Dec 30, 2015 at 05:18 UTC | |
by benaw (Novice) on Dec 30, 2015 at 06:35 UTC | |
by ww (Archbishop) on Dec 30, 2015 at 11:27 UTC | |
by 1nickt (Canon) on Dec 30, 2015 at 06:51 UTC | |
by benaw (Novice) on Dec 30, 2015 at 07:27 UTC | |
| |
by benaw (Novice) on Jan 07, 2016 at 05:54 UTC |