PBeginner has asked for the wisdom of the Perl Monks concerning the following question:
Iam trying to change the awk command to perl on WINDOWS,but unable to get it.Help appreciated.Presently the below is in a shell script which i need in perl.
Iam searching for a value in a txt file and storing in a variable.the search returns multiple values.On these output values i perform awk.
value='"310","00753"' a=`grep $value out.txt| cut -f6 -d'"'` cat=`echo $a | awk '{out=$1;for (k=2;k<=NF;k++){out=sprintf("%s,%s",ou +t,$k);}print out}'`
out.txt is as:
"310","00753","2" "310","00753","2" "310","00753","2" "310","00753","2" "310","00753","2" "310","00753","5" "310","00753","5" "310","00753","2" "310","00753","5" "310","00753","5" "310","00753","5" "310","00753","5" "310","00753","5" "310","00753","5"
need help in converting the above code to perl on windows.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help in converting awk in perl
by Tux (Canon) on Oct 10, 2013 at 06:06 UTC | |
|
Re: Help in converting awk in perl
by NetWallah (Canon) on Oct 10, 2013 at 06:21 UTC | |
|
Re: Help in converting awk in perl
by DrHyde (Prior) on Oct 10, 2013 at 10:02 UTC | |
by Anonymous Monk on Oct 10, 2013 at 10:41 UTC | |
by Happy-the-monk (Canon) on Oct 10, 2013 at 10:57 UTC |