filter or remove pieces of sequences

laszlos

New Member
Joined
Nov 29, 2009
Messages
2
I have a column with thousands of rows like this:

actgctgattgATGGCTGRSTYGG etc., i.e. about 1000 lowercase letters followed by hundreds of capitals always starting with ATG.

I need to remove anything from the ATG on (i.e. all capitals) so that only lowercase letters remain in the column. Alternatively, only the lowercase bunches of letters could be copied to a new column.

I would highly appreciate help on this!

Thanks and greetings,

laszlos
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,755
HI laszlos
Welcome to the board

You can use TextToColumns with delimiter "A"
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,614
Office Version
365
Platform
Windows
I have a column with thousands of rows like this:

actgctgattgATGGCTGRSTYGG etc., i.e. about 1000 lowercase letters followed by hundreds of capitals always starting with ATG.

I need to remove anything from the ATG on (i.e. all capitals) so that only lowercase letters remain in the column. Alternatively, only the lowercase bunches of letters could be copied to a new column.

I would highly appreciate help on this!

Thanks and greetings,

laszlos
Welcome to the MrExcel board!

Try this:

1. Select the column by clicking its heading label.

2. Edit|Replace...|Find what: ATG*|Replace with: leave blank|Options>>|tick 'Match case'|Replace All|Ok|Close
 

laszlos

New Member
Joined
Nov 29, 2009
Messages
2
Hi PGC and Peter,

Thanks a lot, you both made my life easier :).
I notice that TextToColumns not simply splits the text into two columns but also removes the delimiter (in this case A). It is no problem right now but later I might need to save both parts intact. Is there a way to do it?

Thanks,

Laszlo
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,755
I notice that TextToColumns not simply splits the text into two columns but also removes the delimiter (in this case A). It is no problem right now but later I might need to save both parts intact. Is there a way to do it?
Laszlo

TextToColumns eats the delimiters. If you need both parts of the strings, better copy the column and use Peter's solution, to get what's before ATG. You can then get what's after ATG for ex. with a string function. If the ATG string only occurs once in the text, you can also use Peter's solution to get the second part, replacing *ATG with ATG.
 
Last edited:

Forum statistics

Threads
1,085,294
Messages
5,382,766
Members
401,804
Latest member
RB85

Some videos you may like

This Week's Hot Topics

Top