Find/replace
-
Hello. I have a file in which are certain elements with their names. As I want to change names, need the most efficient way to do it.
It looks like this: Name=“109 B29/Web 3”
There is about 1000 of these names, but I would like to select all cases under quotation marks that come after Name=, delete first 4 places, and instead of Web 3 put W3.So, Name=“109 B29/Web 3” should look like Name=“B29/W3”.
Is it possible?
-
It is very easily achieved using regular expressions in Notepad++. Have you tried anything yet?
Someone can easily make it for you, but we like to know first if the poster has tried anything first.
Terry
-
So, Name=“109 B29/Web 3” should look like Name=“B29/W3”.
I should also add that you need to insert the original data within a code box. Please read the FAQ post called
Template for Search/Replace Questions. In your case the double quotation marks you typed have possibly been converted to another type of quote character. Entering examples in the code box prevents this.You should also elaborate on what the transformation is.
Currently it looks like:- remove 4 characters after quote character.
- take characters until a
/reached, include this and 1 following character. - take the last character before the quote character and include that and the quote.
- return the assembled string.
However since you did not explain the transformation, it could well be for #3, take all numbers and return them (rather than just the last character).
Terry
-
@Terry-R
Well, to be honest, this isn’t my area, so that’s why I tried to ask for help.
To try anything else beside standard find/replace inputs, I need to study manual, but additionally understand meaning of all options. In a stressful lifestyle, time is what I miss the most.If you, or anybody else can guide me, I would be thankful.
-
We accept that not everyone can suddenly do regex (regular expressions) but admitting it means we will be happy to help. It’s when users just believe we are a source to be used, rather than the assistance and guidance we’d prefer to try.
You will however need to read my last post as your detail is lacking in substance. Without it we could be on a wild goose chase wasting time back and forwards.
By explaining the transformation to us (and to yourself as you write it) can often show some clarity and maybe you might also be able to achieve it by yourself, or at least get closer to the solution with our help.
Terry
-
Hello, @balancedcircular, @terry-r and All,
In other words, @terry-r suggests that you, both, show us some lines which could stand as an INPUT text and some other lines which could stand as an OUTPUT text !
When inserting these sections, use the
</>icon in your future post, to include them as code / raw text !
For example, the INPUT text could be :
Name="109 B29/Web 3" Name="279 A658/Web 45" Name="56247 H3/Web 123" Name="1234 B987/Web 10"And the OUTPUT text could be :
Name="B29/W3 Name="A658/W45" Name="7 H3/W123" Name=" B987/W10"Where :
-
The first four characters, after the string
Name", are omitted -
The next characters until the
slashand the uppercase letterWare kept -
All remaining
digitsand theclosingquote are also kept
This is just an example and it’s up to you to tell us all or , at least, the most cases that may occur !
Best Regards,
guy038
-
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