Help with finding prefixes & selecting entire string
-
Hello!
I just wanted to ask, if there was a relatively simple way to find the prefix to a string, and automatically highlight the entire string with Find & Replace. What I’m trying to do is mass edit CSV files. The strings are separated by commas.
Let’s say a file has data like this;
bb_1234,aa_1233,cb_1244If I wanted to find all the strings starting with “bb_”, and highlight & replace the entire string, up until the next comma. So replacing the bb_ prefix data with something like ZZZ should make the data appear as;
ZZZ,aa_1233,cb_1244Thank you in advance!
-
@Miska-Virtanen said in Help with finding prefixes & selecting entire string:
If I wanted to find all the strings starting with “bb_”, and highlight & replace the entire string, up until the next comma.
That can be done simply with a regular expression (regex). Using the Replace function you would have
Find What:\bbb_[^,]+
Replace With:ZZZ
Search mode must be set to regular expression.It didn’t sound as if it was only at the start of a line, hence my regex will look for that sequence in any “cell”. If this isn’t what you actually wanted you will need to elaborate.
Terry
-
Terry-R said in Help with finding prefixes & selecting entire string:
@Miska-Virtanen said in Help with finding prefixes & selecting entire string:
If I wanted to find all the strings starting with “bb_”, and highlight & replace the entire string, up until the next comma.
That can be done simply with a regular expression (regex). Using the Replace function you would have
Find What:\bbb_[^,]+
Replace With:ZZZ
Search mode must be set to regular expression.It didn’t sound as if it was only at the start of a line, hence my regex will look for that sequence in any “cell”. If this isn’t what you actually wanted you will need to elaborate.
Terry
Thanks.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login