Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

How to grep until a certain character?

$
0
0
Hi, so I have a file containing many repetitions of the pattern block displayed below:

Code:

>NM_13489075
ACGUGCUAGCUUAGCGA
AGCUAGCUGAUCGAUGC
ACGUAGCUAGCUGAUCG
GAUCGA
>NM_13489023
ACGUGCUAGCUUAGCGA
AGCUAGCUGAUCGAUGC
ACGUAGCUAGCUGAUCG
GAAGUC

I was wondering how to grep, for example, a block starting with the line containing "NM_13489075" and everything else after it until the line with ">NM_#######". So I want to grep:

Code:

>NM_13489075
ACGUGCUAGCUUAGCGA
AGCUAGCUGAUCGAUGC
ACGUAGCUAGCUGAUCG
GAUCGA

I'm doing this for the purpose of replacing the first line with something else, but keeping the rest intact and right under it to be echoed later.

Thanks for any help!

Viewing all articles
Browse latest Browse all 16232

Latest Images

Trending Articles



Latest Images