print next line IF statement
1
0
Entering edit mode
2.5 years ago
gubrins ▴ 290

Heys,

I'm working with a fasta file with several individuals and I want to split them by a particular coordinate in the genome. I wrote this:

for i in $(cat fasta.file);
do
if [[ $i == *"coordinate"* ]];
then
echo $i AND THE NEXT LINE
fi
done

How can I say to print the next line, that in fact is the bases that I am interested in?

Thanks in advance!!

bash • 539 views
ADD COMMENT
2
Entering edit mode
2.5 years ago
grep -A 1 coordinate fasta.file

?

ADD COMMENT
0
Entering edit mode

thanks, easier! I was complicating it too much

ADD REPLY

Login before adding your answer.

Traffic: 2799 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6