This is my test usage of awk and I face the error of "illegal statement". I don't really where goes wrong?
can anyone help? Thanks.
#! /bin/sh
temp="temp"
cat test.dat |awk \
'BEGIN {FS="|"}
{
if [$14 != ""]; then
team_name=$14
else
team_name=$31
fi
print tmp"|"$2"|"$3"|"$4"|"$5"|"$6"|"$7"|"$8"|"$9"|"$10"|"$11"|"$12"|"$13"|"$team_name"|"$15"|"$16"|"$17"|"$18"|"$19"|"$20"|"$21"|"$22"|"$23"|"$24"|"$25"|"$26"|"$27
}
' tmp=$temp > test_out.dat
can anyone help? Thanks.
#! /bin/sh
temp="temp"
cat test.dat |awk \
'BEGIN {FS="|"}
{
if [$14 != ""]; then
team_name=$14
else
team_name=$31
fi
print tmp"|"$2"|"$3"|"$4"|"$5"|"$6"|"$7"|"$8"|"$9"|"$10"|"$11"|"$12"|"$13"|"$team_name"|"$15"|"$16"|"$17"|"$18"|"$19"|"$20"|"$21"|"$22"|"$23"|"$24"|"$25"|"$26"|"$27
}
' tmp=$temp > test_out.dat