Posted on 12/02/2021 3:36:29 PM PST by daniel1212
The basic need is not that of changing all file names (multi commander has that in the menu) but that of changing the case of all the characters within a text that begin with http and end with html.
The situational context (take deep breath) is of html files which used to work on a Windows server, but being now on a Linux server which are case sensitive - and with a unresolvable glitch (read on), then it seems that unless one can edit a server's httpd.conf then clicking on a link that begins with a upper case letter can result in a 404 (as here - tell me if you get a 404 as I do), even though the file is present, and instead requires lower case, as http://peacebyjesus.net/proclamationnationalfastday.html.
However, due to these working in past, having come from a now retired hosting service using a Windows server (which does not have the case sensitive issue) and which were created years ago, and seeing as I had no problem with them working, then now there are loads of links to pages of mine within my files (as well as on the Internet) which use upper case names).
And so even though I have changed most all my file names to lower case yet amid about 400 web pages there are many in them with upper case letters which I want to change, but not one by one. As for the links of mine to pages on the Internet which use upper case names, I am looking at moving to a different hosting company, maybe with a Windows server.
Note that some links that begin with upper case names do work, as this http://www.peacebyjesus.net/Bible/Luke_1.html, while others will not, as this, http://www.peacebyjesus.net/Bible/John_1.html, even though the file name is as it appears (John_1.html), with an upper case J. and in the same folder as Luke.
But this situation became much worse after I tried a htaccess redirect to https, having obtained a SSL certificate (some browsers complain), which did not work, and I deleted the edit (and even all else once) to no avail, and the hosting company cannot help more.
So all that situational context aside, I just want a way to change all the characters within a text that begin with http and end with html.
“...tell me if you get a 404 as I do...”
-
I did not get a 404.
Ping
Program called Notepad++ could be of service to you. Search the web for Notepad++ download and thank the creator Don Ho.
Build a dictionary list of all files. Then process each file and parse word tokens. If the token matches (case insensitive) a file name, then convert the case on that token.
Sounds like a sed and awk project. Unfortunately, I’m rusty. An experience Unix guy would just write the command in a flash.
sed is great at replacing characters like that.
30 years ago I could whip up a lex and yacc parser for this in short order. Today... whats that...
You mean you actually get the web page http://peacebyjesus.net/ProclamationNationalFastDay.html ?
I receive:
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
There are some http server plugins that can automatically correct for incorrect case.
So you could request http://foo.com/ABC.html
So you could request http://foo.com/abc.html
and the file ABC, abc, or even Abc.html will get served.
That said, grep would do the trick.
But since html and http are (usually/conventionally) lower case, you could just go through the files and convert them all to lower case.
Always work on a copy.. easy to make a mistake or not catch an edge case that breaks everything.
If you get stuck, you can always request some help on fiverr or upwork (a job like that might be $15.)
Thanks, I have that, as well as Multi Commander (very robust), GrepWin, but cannot find the option or figure out the regex coding needed to do this case replacement within a sentence. That is why I posted this.
Yes, here it is, plain as day:
-
Proclamation for National Day of Humiliation, Fasting, and Prayer
President Abraham Lincoln
WHEREAS, The Senate of the United States; devoutly recognizing the Supreme authority and just government of Almighty God in all the affairs of men and nations, has, by a resolution, requested the President to designate and set apart a day for National prayer and humiliation.
And Whereas, it is the duty of nations, as well as of men, to owe their dependence upon the overruling power of God, to confess their sins and transgressions, in humble sorrow, yet with assured hope that genuine repentance will lead to mercy and pardon, and to recognize the sublime truth announced in the Holy Scriptures and proven by all history, that those nations only are blessed whose God is the Lord.
And, insomuch as we know that, by His Divine law, nations like individuals are subjected to punishments and chastisements in this world, may we not justly fear that the awful calamity of civil war, which now desolates the land, may be but a punishment inflicted upon us for our presumptuous sins, to the needful end of our national reformation as a whole People. We have been the recipients of the choicest bounties of Heaven. We have been preserved, these many years, in peace and prosperity. We have grown in numbers, wealth, and power as no other nation has ever grown.
But we have forgotten God.
We have forgotten the gracious hand which preserved us in peace, and multiplied and enriched and strengthened us; and have vainly imagined, in the deceitfulness of our hearts, that all these blessings were produced by some superior wisdom and virtue of our own. Intoxicated with unbroken success, we have become too self-sufficient to feel the necessity of redeeming and preserving grace, too proud to pray to the God that made us!
It behooves us, then, to humble ourselves before the offended Power, to confess our national sins, and to pray for clemency and forgiveness.
Now, therefore, in compliance with the request, and fully concurring in the views of the Senate, I do, by this my proclamation, designate and set apart Thursday, the 30th day of April, 1863, as a day of national humiliation, fasting, and prayer. And I do hereby request all the People to abstain, on that day, from their ordinary secular pursuits, and to unite, at their several places of public worship and their respective homes, in keeping the day holy to the Lord, and devoted to the humble discharge of the religious duties proper to that solemn occasion.
All this being done, in sincerity and truth, let us then rest humbly in the hope, authorized by the Divine teachings, that the united cry of the Nation will be heard on high, and answered with blessings, no less the pardon of our national sins, and the restoration of our now divided and suffering Country, to its former happy condition of unity and peace.
In witness whereof, I have hereunto set my hand, and caused the Seal of the United States to be affixed.
Done at the City of Washington, this thirtieth day of March, in the year of our Lord one thousand eight hundred and sixty-three, and of the Independence of the United States the eighty seventh.
Abraham Lincoln, President
William H Seward,
Secretary of State
The Senate resolution requesting the president to proclaim a day for “national prayer and humiliation” was introduced by Senator James Harlan on March 2, and adopted on March 3, 1863.
www.peacebyjesus.net
Email: saved2serve@gmail.com
Bless the LORD, O my soul: and all that is within me, bless HIS holy name. Bless the LORD, O my soul, and forget not all HIS benefits (Ps. 103:1, 2).
I can find all the links, but changing hundreds takes a lot of time.
Whatever problem you are experiencing
is not because of upper case in the file names.
https://stackoverflow.com/questions/3822745/rename-files-to-lowercase-in-powershell
Use -Recurse if you want to change filenames in subfolders too.
"gci" is the PowerShell abbreviation for Get-ChildItem
gci -Recurse |
? { $_.Name -cne $_.Name.ToLower() } |
% { ren $_.Name -NewName $_.Name.Tolower() }
You do that all in a code loop. Should run in under a minute.
You mean Stream EDitor (sed) Thanks. Again, the issue is figuring out what coding is needed/will work to find and change the case on just the links in a specific folder and its subfolders. I will keep looking and reading.
https://stackoverflow.com/questions/47792596/script-to-convert-all-txt-file-content-to-lowercase
You might take a look at this article:
https://www.datasciencebytes.com/bytes/2014/11/13/using-sed-to-make-specific-text-lowercase-in-place/
I thing it will get you close; you just have to adjust the regular expression in the command string to your requirements.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.