NRGdallas
NRGdallas

Reputation: 395

Find & Replace to retain only middle term of three

data1/data2/data3

How can I find and replace all cells with this format to only result in:

data2

Always the MIDDLE term stays.

Upvotes: 1

Views: 186

Answers (1)

tohuwawohu
tohuwawohu

Reputation: 13618

Do a search/replace, with `Regular Expressions" selected (see More Options...) with this regex in the search box:

^.*/(\<[:alnum:]*\>)/.*$

and this as replacement:

$1

This assumes that there are only three "dataX" parts in every cell. If a cell contains data1/data2/data3/data4, its content will be replaced by data3. not data2-

enter image description here

Upvotes: 2

Related Questions