gargamel100
Technical User
Hi people,
I have two scripts which works ok, but I wish I can join them into only one scripts. The scripts are
(first)
##############################################################
awk -F"|" '
BEGIN { print "" }
$21 == "28" && $9 == "90000555" {t=t+1}
$21 == "28" && $9 == "90007666" {z=z+1}
$21 == "28" && $9 == "90008777" {b=b+1}
END {print " 90000 ", t}
END {print " 90007 ", z}
END {print " 90008 ", b}'
# This one sort and print fields $9 into some file
# second script checking for first value and print $1 and $2
# this is ag example
#############################################################
(second)
###########################################################
awk '{if ($1~/90/) print $1 "\t" $2*1;
else
if($1~/91/) print $1 "\t" $2*2;
else
if($1~/92/) print $1 "\t" $2*3;}'
#############################################################
My question is how join script " first" and "second " in this case into one script?
Regards
I have two scripts which works ok, but I wish I can join them into only one scripts. The scripts are
(first)
##############################################################
awk -F"|" '
BEGIN { print "" }
$21 == "28" && $9 == "90000555" {t=t+1}
$21 == "28" && $9 == "90007666" {z=z+1}
$21 == "28" && $9 == "90008777" {b=b+1}
END {print " 90000 ", t}
END {print " 90007 ", z}
END {print " 90008 ", b}'
# This one sort and print fields $9 into some file
# second script checking for first value and print $1 and $2
# this is ag example
#############################################################
(second)
###########################################################
awk '{if ($1~/90/) print $1 "\t" $2*1;
else
if($1~/91/) print $1 "\t" $2*2;
else
if($1~/92/) print $1 "\t" $2*3;}'
#############################################################
My question is how join script " first" and "second " in this case into one script?
Regards