Can I search and replace in more than one page at once
-
Problem one:
I just uploaded 60 pages of my new site. Just to realize, that I have the same mistake in the navigation on every single page. Is there a posibility to change this mistake on all pages? I can’t even do search and replace in one file, because the search and replace concerns two lines, and that does not work.
Maybe I should have used wordpress (yuck) after all, changes in navigation are easy to change there (but that is the only thing I can say positive about wordpress).
It is not the problem to upload that all again, but to open every single file, change, and close again.
(Way back in the 1990ies, when I did use Frontpage to make my sites, it was possibel to do just that… memories…)Problem two:
Spelling is not working for german words. notepad underlines almost every german word. Is there a simple way to change spelling (only content) to German?A quick help would be much appreciated. (I tried so search the forum, funny, nobody seems to have my problems…)
-
@kichererbse said:
I just uploaded 60 pages of my new site. Just to realize, that I have the same mistake in the navigation on every single page. Is there a posibility to change this mistake on all pages? I can’t even do search and replace in one file, because the search and replace concerns two lines, and that does not work.
You don’t mean that?
http://i.hizliresim.com/PQZov5.jpg -
I thought some time ago that this would be the solution.
As it is, I have to add a complete new line like this:<li><a href=“link is already online1.htm”>existing link1</a></li>
<li><a href=“link that I forgot and should ad.htm”>link that should be added in between</a></li>
<li><a href=“link is already online2.htm”>existing link2</a></li>so, I wanted to search :
<li><a href=“link is already online1.htm”>existing link1</a></li>
and replace with:
<li><a href=“link is already online1.htm”>existing link1</a></li>
<li><a href=“link that I forgot and should ad.htm”>link that should be added</a></li>and this does not work, it seems, as if I could only add as much as fits in one line…
I could probably just write the whole code in one line, then it would maybe work - I have not tried it, yet, but thats not a very clean solution, is it?
What is the secret of “wrap around”?
-
I could not edit my last answer. I know what wrap around is, sorry.
How could this replacement-line work?
-
The multiple search and replace is supposed to work with \n option or regular expression
-
Hello kichererbse,
Ah, remember : With Notepad++, much more solutions than problems !!!
I suppose that your 60 HTML pages are gathered in a same folder ?
-
First of all, just BACKUP this folder ( One never knows !! )
-
Start Notepad++
-
Open just one file, among your 60 HTML files
-
Open the Find in Files dialog ( CTRL + SHIFT + F )
-
In the Find what: zone, type the string
<li><a href="link is already online1\.htm">existing link1</a></li>
-
In the Replace with zone, type the string
<li><a href="link is already online1.htm">existing link1</a></li>\r\n<li><a href="link that I forgot and should ad.htm">link that should be added</a></li>
-
In the Filters : zone, type
*.htm
or may be,*.html
-
As soon as you check the Follow current doc option, the absolute path of your HTML files should be written in the Directory : zone
-
Uncheck the options In all sub-folders and In hidden folders
-
At the bottom, in the Search Mode area, select the Regular expression option ( IMPORTANT )
-
Click on the Replace in Files button
=> The message, below, appears :
Are you sure you want to replace all occurrences in : C:\....\.....\....\Name of your folder for file type : *.html
Click on the OK button
=> At once, all your files will be modified, and saved, again, automatically :-))
Et voilà !
Notes :
-
The regex search expression is quite identical to your text, except for the dot, which must be escaped
\.
, to be taken literally, as it’s a special regex symbol ! -
Similarly, the regex replacement expression is quite identical, except that I added the form
\r\n
, between the text of the two lines. Indeed, these two characters represent the two EOL Windows characters (CR + LF
), in order to rewrite the replacement zone, in two consecutive lines -
If you’re using Unix files, just add the form
\n
, instead of\r\n
! -
In the replacement zone, the dot symbol is considered as a normal dot character
IMPORTANT :
If you select the search and replacement regexes, from your browser, and paste them, in a Notepad++ new tab, may be you’ll have to replace the two Unicode characters
“
and”
by the standard"
double quote character, before putting them in the Find in Files dialog !!Best Regards,
guy038
P.S. :
You’ll find good documentation, about the new Boost C++ Regex library, v1.55.0 ( similar to the PERL Regular Common Expressions, v1.48.0 ), used by
Notepad++
, since its6.0
version, at the TWO addresses below :http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html
-
The FIRST link explains the syntax, of regular expressions, in the SEARCH part
-
The SECOND link explains the syntax, of regular expressions, in the REPLACEMENT part
We may, also, look for valuable informations, on the sites, below :
http://www.regular-expressions.info
http://perldoc.perl.org/perlre.html
To end with, you may ask, the N++ Community, for infos on any tricky regex that you came across OR for building any tricky regex, for a particular purpose :-))
-
-
That did it. Unbelievable. I knew notepad++ is a mighty tool, but one has to know, how to use it. (Besides klicking on “Regular expression” I had to select "Finds \r \n. )
Problem solved. Thank you ever so much! -
Hi, it’s me again. I tried
search
<link rel=“stylesheet” href=“http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css”>
and replace (with httpS)
<link rel=“stylesheet” href=“https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css”>
and it did not work?Where would I place a - is it called backslash - if I need to?
Thanks!
-
Hi, kichererbse,
I think that you may perform that specific S/R, simply, in Normal search mode !
Depending on the change of http into https must be run on all the links of your file or, strictly, on the addresses relative to the cdnjs.cloudflare.com site :
-
Select the searched string http or all the contents between quotes
-
In replacement, repeat the searched expression, just adding the s letter, after the string http
Best Regards,
guy038
-