Search and replace using quantifiers.
Example:
This will erase all checkID's with single and/or double digits.
:%s/"checkID":[0-9]\{1,2\} //g
Before
Running command.
Example:
This will erase all checkID's with single and/or double digits.
:%s/"checkID":[0-9]\{1,2\} //g
Before
Running command.
#!/usr/bin/perl
#-------------------------------------------------------------------------
# Using getop
#-------------------------------------------------------------------------
use Getopt::Std;
getopt('cw');
my @op = `./x.sh -c $opt_c -w $opt_w`;
foreach (@op)
{
#printf "-c %s\t-w %s\n", $opt_c,$opt_w;
print $_;
}
my %options=();
#Pre set default values
my $critv=95;
my $warnv=85;
getopts("c:w:", \%options);
$critv = $options{c} if defined $options{c};
$warnv = $options{w} if defined $options{w};
01201 095440 sd10 3393.2 1.1 13572.8 4.4 0.0 1.0 0.3 2 91
awk '{h=substr($2,1,2);\
m=substr($2,3,2);\
s=substr($2,5,2);\
$2=sprintf("%s:%s:%s",h,m,s);\
print $0;}' a.txt | head 101201 09:54:40 sd10 3393.2 1.1 13572.8 4.4 0.0 1.0 0.3 2 91
$ls -lat /current/*xml | \
nawk '{printf "%s ", $8; system("basename " $9)}'