karthik92 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
i need a delete a line if it starts with a blank space. my file looks like below
*************************************** 1234 pass 25 30 1 pass 25 30 2 1965 pass 35 45 1 pass 35 45 2
use strict; use warnings; set LINES=40; set COLUMNS=80; open(my $in , "<" , "UR59_rev162_1KLoops_LastRun_SITEC1.txt") or die " +can't open input.txt $!"; open(my $out , ">" , "UR59_rev162_1KLoops_LastRun_SITEC1_deleted.txt") + or die "can't open out.txt $!"; while(<$in>) { if( $_ != /^\s/) { print $out $_; } }
but this code giving warning like ********** is not numeric.
2017-12-22 Athanasius added code and paragraph tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Delete a line
by 1nickt (Canon) on Dec 22, 2017 at 04:01 UTC | |
|
Re: Delete a line
by thanos1983 (Parson) on Dec 22, 2017 at 09:15 UTC | |
by Laurent_R (Canon) on Dec 22, 2017 at 19:53 UTC | |
by thanos1983 (Parson) on Dec 24, 2017 at 16:57 UTC | |
by Anonymous Monk on Dec 22, 2017 at 21:34 UTC | |
|
Re: Delete a line
by Anonymous Monk on Dec 22, 2017 at 15:43 UTC |