Author Topic: Change all links in files in selected folders to lower case  (Read 12339 times)

saved2serve

  • Newbie
  • *
  • Posts: 2
  • peacebyjesus.net/
    • View Profile
Change all links in files in selected folders to lower case
« on: December 02, 2021, 14:29:16 »
 I am trying to figure out what regex string to use in order  make all characters only btwn http:// and .html within all files in  selected   folder(s)  into   lower case.  Since Linux servers are case sensitive then it seems  (unless one can newbielink:https://brianflove.com/2014-08-11/lowercase-your-uris/ [nonactive]) then  clicking on a link that begins with a upper case letter can result in a 404 (as newbielink:http://www.peacebyjesus.net/Bible/John_1.html [nonactive]). Thus I would think it would be helpful for there to be a simple option in the Multi Rename tool to do that (or which I do not see is there already).

 
« Last Edit: December 03, 2021, 03:28:13 by saved2serve »
Thanks. Grace and peace thru Jesus the Lord.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4407
    • View Profile
    • Multi Commander
Re: Change all links in files in selected folders to lower case
« Reply #1 on: December 03, 2021, 08:52:01 »
Menu > Tools > Rename
And select lower case.  And all selected files/folders are renamed to lower case


saved2serve

  • Newbie
  • *
  • Posts: 2
  • peacebyjesus.net/
    • View Profile
Re: Change all links in files in selected folders to lower case
« Reply #2 on: December 07, 2021, 03:43:48 »
Thanks but I had done that and which  was easy to do, but what I had asked was to change  all characters  btwn http:// and .html within all files in  selected   folders, not just the folder and files names.  I looked at lot for the solution ("pray and press")  and what I found as a result was that  to convert upper case letters in links to lower case then

Code: newbielink:javascript:void(0); [nonactive]
(http.*[A-Z].*\.[a-zA-Z]{2,4}) worked as a regex in Text Crawler free (though mine is an old ver. 3.0.3) to find 2,238 links in a large file of mine,

as does "http[s]?://.+?"

though (courtesy of Stefan from Grepwin) the pattern of

((http|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])) - which includes the parenthesis - seems to find more (3,2006) and also,

href="http[s]?://.+?" finds 3,0033 In Text Crawler.

I did not try  \L\1 to convert to lower case since that is an option offered in the program, and running the above resulted in 3,0033 being changed, though it only changed the case.
I had also found newbielink:http://e.informer.com/sobolsoft.com/html HTML Tags Change To Uppercase or Lowercase Software [nonactive] that converts uppercase letters in links to lower case, though it is $20 if you want to convert more than one file at a time, and is very slow or can locks up with large files, but it seemed to work well to convert upper case letters in links to lower case in files that I used it for.

I do not know regex (imagine a world in which this was the written language!) but was looking to convert all the upper case caps in links to lower case, and I searched a lot trying to find out how to do this. And so thanks to all who help, whom I thank God for.

Thanks. Grace and peace thru Jesus the Lord.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4407
    • View Profile
    • Multi Commander
Re: Change all links in files in selected folders to lower case
« Reply #3 on: December 07, 2021, 07:31:52 »
So you got file that are named as urls?  hmm wait you can't have : in a file name so you must then mean you got a text file and the in that text files you got URL's ?