in reply to Re: Substitution in range operator
in thread Substitution in range operator
Thanks for your response,
I created an output file using my original script because that is what puts the pipes in
## Substitute 2 or more horizontal white space with pipe s/[\h+]{2,}/|/g;
then i passed that file through your script it finds the pipe and replaces it with a space but it is still on a separate line.
#!/usr/bin/perl local $/; open my $fh, '<', 'whitespacegone.txt' or die $!; my $txt = <$fh>; $txt =~ s/(\n\|)/ /mg; for ( split '\n', $txt ) { # process each line } print $txt;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Substitution in range operator
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 Jan 07, 2016 at 05:54 UTC | |
by benaw (Novice) on Dec 30, 2015 at 07:27 UTC | |
by benaw (Novice) on Dec 30, 2015 at 07:43 UTC | |
|