How to use the character being replaced in the replacement text again?
For eg - in the text -> a's id is 12, b's id is 13, c's id is 14
I then want to get person's name and id and replace it as a=12, b-13, c-14, likewise.
Is it possible with notepad++?
It would be great help, if anybody could come up with a solution of it, if possible?
Hello Rahul Rusia,
I didn't understand exactly which kind of S/R you're looking for ! But conditional replacements, in regular expression search mode, may interest you !
So, if you use the 6.0 version of N++ or a newer version, and if the Regular expression search mode is SET :
SEARCH : (Word1)|(Word2)|(Word3)|...|(Wordn)
REPLACE : (?1WordA)(?2WordB)(?3WordC)...(?nWordX)
Then a mouse click on the Replace All button change, in the current file :
So, this kind of S/R allow you to do more than one S/R, at the same time !
For example :
SEARCH : ( €)|(S/R)|(Regexp?) with a space before the Euro sign
REPLACE : (?1 Euro)(?2Search/Replacement)(?3\3 Pattern) with a space before the words Euro and Pattern )
(?1 Euro)(?2Search/Replacement)(?3\3 Pattern)
will replace the subject string :
This S/R, with the search Regexp = ".*€$", will select all the lines, ending with the symbol €.
by the sentence :
This Search/Replacement, with the search Regexp Pattern = ".*€$", will select all the lines, ending with the symbol Euro.
Hope this specific S/R can be useful to you ?!
hey thanks for the support you provided, with a great details but what I have with myself is huge amount of data with each line containing a word(different for different lines), also the word in each line is different but we know the actual occurence of that segment is after few fixed words.
For eg - X Y Z REPLACEMENT Y H J
here x y z and y h j are fixed but the word replacement is different for different lines.
I want to replace above line as NEW WORD = REPLACEMENT.
And the data is large, i was thinking if notepad++ could support such needs?
Hi Rahul Rusia,
I'm sorry but I don't exactly see what you want to achieve, yet. Do you mean that the lines :
X Y Z Word_to_Replace1 Y H J
X Y Z Word_to_Replace2 Y H J
X Y Z Word_to_Replace3 Y H J
X Y Z Word_to_Replacen Y H J
have to be changed into :
X Y Z NEW WORD = Word_to_Replace1 Y H J
X Y Z NEW WORD = Word_to_Replace2 Y H J
X Y Z NEW WORD = Word_to_Replace3 Y H J
X Y Z NEW WORD = Word_to_Replacen Y H J
I don't think that I understood your needs because this kind of S/R seems obvious : Just change the word Z by the literal string Z NEW WORD =, as the word Z is known and doesn't change !
May be, I won't answer you immediately because it's about 11.00 p.m., in France and I need to get up at 5.00am tomorrow. So, I would rather go to bed, right now !
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.