in reply to Re: match digit, followed by hyphen, followed again by digit - then add whitespaces and replace in file
in thread match digit, followed by hyphen, followed again by digit - then add whitespaces and replace in file
#!/usr/bin/perl use warnings; use strict; my $test; my $output; open my $INPUT, '<', "file.txt" or die $!; while (<$INPUT>) { chomp $_; s/(\d)-/$1 -/g; open $output, '>>', "test"; printf $output ("%10s \n", "$_"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: match digit, followed by hyphen, followed again by digit - then add whitespaces and replace in file
by choroba (Cardinal) on Aug 17, 2017 at 13:21 UTC |