Tu Trinh
Tu Trinh

Reputation: 157

Take a sub string from a string from the end of the string to the first dot in Excel?

I want take a sub string from a string from the end of the string to the first dot in Excel.

From:

de.hybris.platform.jdbcwrapper.PreparedStatementImpl
de.hybris.platform.persistence.GenericBMPBean$FindByPKListFinderResult
de.hybris.platform.cache.AbstractCacheUnit
de.hybris.platform.cache.AbstractCacheUnit
de.hybris.platform.cache.AbstractCacheUnit

The results are:

PreparedStatementImpl
GenericBMPBean$FindByPKListFinderResult
AbstractCacheUnit
AbstractCacheUnit
AbstractCacheUnit

Help me, thanks?

Upvotes: 0

Views: 50

Answers (2)

Wu Yuan Chun
Wu Yuan Chun

Reputation: 1184

You can use regular expression to find "anything until last dot" and replace those match by empty string. The regular expression is .*\.

.* means char for limited number

\. means character dot

.*\. means: please match anything for unlimited number followed by a dot

Upvotes: 1

J.B.
J.B.

Reputation: 445

Assuming your strings starts from A2 down to A6. Write the formula =TRIM(RIGHT(SUBSTITUTE(TRIM(A2), ".", REPT(" ", 99)), 99)) in B2 and drag it down till end.

Upvotes: 1

Related Questions