swasid
1
Hi,
I have a file in which the entries are of the following type:
5649 S 1
0412 S 0
0423 S 1
0020 N 0
0020 N 0
1022 S 1
1022 S 1
I need to print the whole line which is having 0 in the third column into a different file
Thanks in advance.
clx
2
awk '$3==0{print > "new_file"}' file
or even,
awk '$3==0' file > new_file
through sed..
sed -n 's/0$/&/p' inputfile > outfile
alister
5
Simpler implementation of that approach:
sed -n '/0$/p' inputfile > outfile
Regards,
Alister
Ah!! yes i didn think of that.. Thank you.And more simpler below..
sed '/0$/!d' inputfile > outfile