Entering edit mode
6.7 years ago
arsilan324
▴
90
Hi all,
I am trying to extract lines containing specific word from tabular file! I am using this command
grep "[Sorghum bicolor]" file.txt
Here [Sorghum bicolor] is the word (desired string) for the line which i want to retain. But this comamnd print everything as it is and doesn't filter. I have used -E and -i as well. Also, I want to do the reverse, print lines without this word. Can you please comment? Thanks in advance
For some reason, the output file is still empty. Can you comment on it? Here is the link to the file
You'll probably need
Thanks! - some things about your file: the formatting is 'all over the place' and it does not look to be in the proper encoding. It looks like you ported it from Excel or something? I cannot confirm because, perhaps, DropBox has modified something.
Look at the file in VIM and you will see many
^M
characters, and also runwc -l
on the file an you'll get 0 lines. Ensure that the encoding is correct first. Try functions likedos2unix
, etc ( take a look here: https://kb.iu.edu/d/acux ).