I am new to AWK....I have these lines of codes, tried to run and received error but didn't understand the error msg.
awk '
var1 = length($3)
if (var1 = 6)
nawk -F, '{OFS=","; print $1,$2,"00"$3" ",$8}' /tmp/payfile > /tmp/paywork1
if (var1 = 5)
nawk -F, '{OFS=","; print $1,$2,"000"$3" ",$8}' /tmp/payfile > /tmp/paywork1
'
Please help!
awk '
var1 = length($3)
if (var1 = 6)
nawk -F, '{OFS=","; print $1,$2,"00"$3" ",$8}' /tmp/payfile > /tmp/paywork1
if (var1 = 5)
nawk -F, '{OFS=","; print $1,$2,"000"$3" ",$8}' /tmp/payfile > /tmp/paywork1
'
Please help!