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
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

pgc01

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

You can use TextToColumns with delimiter "A"
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. 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,877
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:

Watch MrExcel Video

Forum statistics

Threads
1,122,232
Messages
5,594,962
Members
413,954
Latest member
mrsandy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top