hi i've already created this script. When I execute the script it takes the argument and compares it to the 3rd column of the script. What I was wondering if I could get some help with is. I want to add another column to the script and it will be the result of a set number for example, (2000 - 3rd column)/4th column.
cat file
text text 600 80 text
while read line
do
let arg=$1
gawk '{{
if ($3 < '$arg') printf "*%-10s %-8s %2d %5d $ %8.2f\n", $1, $2, $3, $4, $5;
else
printf "%-10s %-8s %2d %5d $ %8.2f\n", $1, $2, $3, $4, $5 }}'
done < file
I am looking for the result to come out like
text text 600 80 text (Result of (2000-600)/80)
It might be something like this but I was having trouble in writing a code to work in the printf field.
while read line
do
let arg=$1
let set=2000
gawk '{{
if ($3 < '$arg') printf "*%-10s %-8s %2d %5d $ %8.2f\n", $1, $2, $3, $4, $5, $6;
else
printf "%-10s %-8s %2d %5d $ %8.2f\n", $1, $2, $3, $4, $5 }}'
done < file
thanks for the help