Need help deleting any text between other text
-
The scenario is this: I have thousands of lines that look like this:
<Path>C:\random name\random name.zip<path>And i need it to be
<Path>C:\random name.zip<path>Basically i need to delete the duplicated name in every line because those files are not in subfolders of the same name anymore.
Thanks in advance!
-–moderator added code markdown around text; please don’t forget to use the
</>button to mark example text as “code” so that characters don’t get changed by the forum -
FIND WHAT =
\\(.*?)\\(\1)
REPLACE WITH =\\$1
SEARCH MODE = Regular ExpressionExplanation
FIND:\\is a literal backslash(.*?)says grab text and put it in group1\\until it hits the next backslash(\1)says match the same text that was in group1
REPLACE:
$1refers to the contents of group1
-—
Useful References
-
Thank you!
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