I have these words: TOP and LOCK. I have 49 times this word but I would like to replace it with a different word a lot of times. For example, the first time with luc and the second times with pile.
I would like to make it automatically. I have the list of the replace words in a text file. I use Notepad++.
I have searched on many sites, but cannot find a good solution.
I don't have notepad ++ but can you highlight and right click there's an option to replace? or highlighting it then clicking format at the top and clicking replace and finally using Ctrl + F and replacing it that way? sorry if i could not help :)
try this:
tap ctrl + F
you can look at this pisture to get the picture:
http://im34.gulfup.com/Vkws5.jpg
Hope it help you
Highlight TOP
Press Search on top menu bar
Go to Replace
Under Find What, in Replace with field type what you want to replace it with
Then hit Replace All
You will then see the changes
I'm not very familiar with Notepad++ but I can do this with Sublime Text. I guess it doesn't hurt for you to try it out.
First, select all the words you want to replace with multiple cursor mode. Basically you can find TOP|LOCK with regular expressions, and hit Alt+Enter to convert the found words to multiple cursors.
Second, copy the words you want to replace and use the Text Pastry plugin to paste them in, one word at each cursor.
See here for a demo: http://imgur.com/a/KrBB8#0
Related
I have a log statement that looks like this:
Log.debug("text={}", "something");
That I want to replace with:
Log.debug("something");
Instead of doing a ctrl+F and going one by one to replace this is there a way to replace everything at once with any combination of intelliJ macros + scripting + regex?
There are two ways of doing this:
1.) You could use the ctrl + f way, but search for the entire statement
Log.debug("text={}", "something");
and then go to the replace textbox and type the desired statement
Log.debug("something");
and then just hit the Replace All option.
2.) The other way is with a regex, but you will invest more time in creating a regex that match what you need and then replace it with the statement you want. I recommend you using the first way since it would minimize the time invested.
EDIT.
There are 2 more ways:
The 3rd way, you could use the Add Selection for Next Occurrence short cut (hit ALT+CTRL+S and search for that option and see its shortcut or assign one if there isn't one) and then just highlight the statement you want and hit that shortcut until you find them all and then type the desired statement.
The 4th way, highlight the statement and hit the Rename... shortcut (find the shortcut the same way explained on the 3rd way) and it will refactor all the matches.
Careful with the last one because intellij sometimes match all those occurrencies in all the project/projects you have open at that time in the same project structure; Of course, you could check and uncheck the ones you want to change and those who you don't want to.
Let me know if any of these possible solutions worked for you =).
Zoom src/main/java/com/directv/acm/utils 80,9%
Zoom src/main/java/com/directv/acm/restclient/impl 81,0%
Hi guys, I'm trying to remove everything except numbers in my document. It's a ton of lines like this. Can anyone please write a regex for me in order to just keep the number only? Please.I hope that the result after modifying look like this (delete everything except the numbers):
80.9
81.0
My great thank to you!
Type CTRL + H for replace then ^.*(?=\d{2},) on the search field. Enable the Regular expression checkbox on the Search Mode and press the Replace All button
Try this:
Ctrl+ H to bring up the Replace dialog
In Find what, enter: [a-zA-Z /\%]*
In Replace with, enter: \n or leave it blank
Check: Regular expression option at the end
Click replace all
I have a problem about find and replace in notepad++
I want to find a space+space in text and replace with just one space. But my area i want to find and replace is between start function and close function (ex: <div>...</div>). My file is .xml so it have alot of function.
So please help me. Thanks for your great help :)
Highlight the selected area, Ctrl+F for Find, hit the Replace tab, make sure the In Selection box beside Replace All is ticked.
I've been searching a lot in the web and in here but I can't find a solution to this.
I have to make two replacements in all registry paths saved in a text file as follows:
replace all asterisc with: [#42]
replace all single backslashes with two.
I already have two expressions that do this right:
1st case:
Find: (\*) - Replace: \[#42\]
2nd case:
Find: ([^\\])(\\)([^\\]) - Replace: $1$2\\$3
Now, all I want is to join them together into just one expression so that I can do run this in one time only.
I'm using Notepad++ 6.5.1 in Windows 7 (64 bits).
Example line in which I want this to work (I include backslashes but i don't know if they will appear right in the html):
HKLM\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\
I already tried separating it with a pipe, like I do in Jscript (WSH), but it doesn't work here. I also tried a lot of other things but none worked.
Any help?
Thanks!
Edit: I have put all the backslashes right, but the page html seem to be "eating" some of them!
Edit2: Someone reedited my text to include an accent that doesn't remove the backslashes, so the expressions went wrong again. But I got it and fixed it. ;-)
Sorry, but this was my first post here. :)
As everyone else already mentioned this is not possible.
But, you can achieve what you want in Notepad++ by using a Macro.
Go to "Macro" > "Start Recording" menu, apply those two search and replace regular expressions, press "Stop Recording", then "Save Current Recorded Macro", there give it a name, assign a shortcut, and you are done. You now can reuse the same replacements whenever you want with one shortcut.
Since your replacement strings are totally different and use data that come not from any capture (i.e. [#42]), you can't.
Keep in mind that replacement strings are only masks, and can not contain any conditional content.
I want to remove inline style from an html document in ST2.
I imagine my regex will be something like this
style=\"*\"
If that's wrong, it doesn't matter. I'm sure I'll figure out the expression I'll need.
What I haven't been able to figure out, is how to actually use a regex to find or to find and replace text in ST2. The docs say that it can be done. But I can't find the documentation for how to do it.
Simply open the Search+Replace function (via Ctrl-H or the menu bar) and check the first box on the left of it (the one with an '*' on it, or you can press Alt+R)
Then the search field will be used as a Regex, and you can use the found patterns using the usual $1, $2, $3 vars in the replace box
More info here
I had a similar task to perform, the regex I used in the manner that Nas62 suggested was
style=\"(.*?)\"
Find What : style=".*" Replace With : leave it as blank
Click Replace All button.