Find and replace 3rd occurrence of symbol (changing CSV)
-
Here the example
D:America:US:CA:Springfield:92584
How we’d like to turn out is
D:America:US:CA - Springfield:92584This way the state and city are together
I look forward to your guidance and suggestions
-
@Robert-Barba said in Find and replace 3rd occurrence of symbol (changing CSV):
I look forward to your guidance and suggestions
With only 1 example line it’s possible you haven’t presented enough versions of data for me to be entirely convinced this will work completely.
However using the Replace function we have
Find What^([a-z]+:){3}[a-z]+\K:
Replace With:\x20-\x20
the \x20 is a space and can be entered by you as a space. I’ve just shown the code for it so you can see there is additional characters in the replacement field.
The search mode needs to be regular expression.If this doesn’t work as expected you will need to supply more examples. Those additional examples need to be loaded inside of a code box. Please read this post titled Please Read This Before Posting which you would have seen when looking at the forum. They are there to help you and us to limit the number of back and forward questions that ultimately arise due to low (insufficient) examples and information.
Good luck
TerryPS by the way your title is wrong, from the example you show it is the 4th occurence you want changed, not the 3rd.
-
thank you, and I didn’t realize it was the 4th… lol!
here are 5 examples all of various lengths.D:America:US:CA:Springfield:92584
D:America:US:OR:Salem:97301
D:America:US:NH:Portsmouth:03801
D:America:US:NJ:Little Egg Harbor:08087
D:America:US:IL:Oak Brook:60523