Hi guys
Need your help how do I extract sentences with only a word
i.e.
today is hot
hot
very
[tab]humid
humid2
Sample output
hot
very
humid
humid2
Thanks
Hi guys
Need your help how do I extract sentences with only a word
i.e.
today is hot
hot
very
[tab]humid
humid2
Sample output
hot
very
humid
humid2
Thanks
This should give what u want....
nawk 'NF==1 {print}' filename
Thanks
SHa
WOW! thanks Shahul!
Try this:
awk 'NF==1' your_file
Hi,
Using 'perl':
$ perl -ne 'print +(map { s/^\s*(\S+)\s*$/$1/; $_ } $_), "\n" if /^\s*\S+\s*$/' infile
Regards,
Birei
This gets rid of the tab
awk 'NF==1 && $1=$1' infile