so if any of the lines/rows in the file has 3 only records (last field is empty), i want to place a | at the end of the row/line, so the output should be like
awk -F"|" 'if(NF==3) {print $0}"|" ; else {print $0}' 1.sql
Syntax Error The source line is 1.
The error context is
>>> if <<< (NF==3) {print $0}"|" ; else {print $0}
awk: 0602-500 Quitting The source line is 1.
enclosed if and else in {}, but the out put was not the desired.