[SOLVED] nawk FS using pipe read variables from file

view story

http://www.unix.com – I have a file data_1.out which contains: Code: 1|abc mail|mail subject|mail body 2|def mail|mail subject|def mail body I am trying to read the variables from data_1.out and use them to print to 2 different files based on the id (first_column) The problem is I am not able to read the file using FS in the nawk. Could some help me out. If I substitute the "|" with space in data_1.out below thing works. Code: nof=`wc -l data_1.out | awk ' { print $1 }'` no_of_lines=`expr $nof - 0` z=1 while [[ $z -le $no_of_lines ]] do cat data_1.out | nawk -v I="$z" 'NR==I { prin (HowTos)