Re: RegEx pattern find something but replace on following - ADDED

18 views
Skip to first unread message

Bruce Van Allen

unread,
Apr 12, 2020, 12:06:25 PM4/12/20
to bbe...@googlegroups.com
Hmm. Not seeing the '>.' anywhere.

Or did you mean the '.' as a regex character?



On 4/12/20 at 8:01 AM, achim....@gmail.com (archaeal) wrote:

> Hello,
> I would like to detect the lines starting with >.+ and replace all U with T
> in the following line, but not in the line starting with >
> Example:
>
> >NeiUe166 1551 bp rna
> AGAGAUUGAACAUAAGAGUUUGAUCCUGGCUCAGAUUGAACGCUGGCGGCAUGCUUU
> >Unc31652 1491 bp rna
> AGGGUUUGAUCAUGGCUCAGGACGAACGCUGGCGGUGCGCCUUAUGCAUGCAAGUCG
> >Unc31653 1469 bp rna
> AGGGUUUGAUCAUGGCUCAGAACGAACGCUGGCGGCAUGCUUCAGACAUGCAAGUCG
>
> should look like:
> >NeiUe166 1551 bp rna
> AGAGATTGAACATAAGAGTTTGATCCTGGCTCAGATTGAACGCTGGCGGCATGCTTT
> >Unc31652 1491 bp rna
> AGGGTTTGATCATGGCTCAGGACGAACGCTGGCGGTGCGCCTTATGCATGCAAGTCG
> >Unc31653 1469 bp rna
> AGGGTTTGATCATGGCTCAGAACGAACGCTGGCGGCATGCTTCAGACATGCAAGTCG
>
> The search pattern should find the >.. line but make changes only in the
> next line
> Another possibility would be to search just in the "second" line for U and
> replace with T
>
> It would be great if someone has an idea.
>
> Thanks a lot
> archaeal
>
>
--

- Bruce

_bruce__van_allen__santa_cruz__ca_

Rich Siegel

unread,
Apr 12, 2020, 12:09:15 PM4/12/20
to bbe...@googlegroups.com
On 4/12/20 at 12:06 PM, b...@cruzio.com (Bruce Van Allen) wrote:

>Hmm. Not seeing the '>.' anywhere.
>
>Or did you mean the '.' as a regex character?

Your email client is being excessively clever, and thinks the
">" at the start of the line is a quote character.

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <https://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.

archaeal

unread,
Apr 12, 2020, 2:50:59 PM4/12/20
to BBEdit Talk
Hi,
strange, I try it again:

Hello, 
I would like to detect the lines starting with >.+ and replace all U with T 
in the following line, but not in the line starting with > 
Example: 

>NeiUe166        1551 bp          rna 
AGAGAUUGAACAUAAGAGUUUGAUCCUGGCUCAGAUUGAACGCUGGCGGCAUGCUUU 
>Unc31652        1491 bp          rna 
AGGGUUUGAUCAUGGCUCAGGACGAACGCUGGCGGUGCGCCUUAUGCAUGCAAGUCG 
>Unc31653        1469 bp          rna 
AGGGUUUGAUCAUGGCUCAGAACGAACGCUGGCGGCAUGCUUCAGACAUGCAAGUCG 

should look like: 
>NeiUe166        1551 bp          rna 
AGAGATTGAACATAAGAGTTTGATCCTGGCTCAGATTGAACGCTGGCGGCATGCTTT 
>Unc31652        1491 bp          rna 
AGGGTTTGATCATGGCTCAGGACGAACGCTGGCGGTGCGCCTTATGCATGCAAGTCG 
>Unc31653        1469 bp          rna 
AGGGTTTGATCATGGCTCAGAACGAACGCTGGCGGCATGCTTCAGACATGCAAGTCG 

The search pattern should find the >.. line but make changes only in the 
next line 
Another possibility would be to search just in the "second" line for U and 
replace with T 

It would be great if someone has an idea. 

Thanks a lot 
archaeal 


 

The lines with ">" are for example: ">Unc31653        1469 bp          rna "

Thanks
Achim
Reply all
Reply to author
Forward
0 new messages