I am trying to print the multiple columns from the file with different sub commands with the awk
command.
Below is my command which throws error while using concatenate command with awk
awk -F\| '{if(length($1) == 12 && $21 == "SOUTHWEST") print $1 "," substr($2,5,9) "," c == $3$15; print c }' sample.txt | head > test.csv
error thrown as "syntax error near c"
sample.txt will contains data like
0011D959A6BC|308-452591505|70605|1|1|TCD2000||LK012|0|||1|0||2581|850|Lake Charles, LA|308|||SOUTHWEST|null|Lake Charles, LA|1|A9200019036CF2B|1|1|0
Expected output: 0011D959A6BC,452591505,706052581
I used below syntax as example to concatenate in my script
echo '12345|123|6789'| awk -F\| '{c=$1$2; print c}'
c
here? What isc == $3$15
, is it supposed to be assignment or comparison?...