/    Sign up×
Community /Pin to ProfileBookmark

Filenames – Linux from Windows – Allcaps

Hi,

I’m having some trouble with filesnames when I switched from a windows server to a linux server.

I am doing some work for a client and the filenames have been named several different ways.

Example:

INDEX.HTM
Australia _jump.htm
Austrailia_Kick.htm
emily pic.gif
Emily_pic.gif

In the html files most of the files are all in lowercase except for some folder names and html files. Now that I am using a linux server I need to make sure all the filenames in the html match the case in the filenames on the server. I would like o eliminate all uppercase letters in the filename and in the html.

How would you do this?

Thanks for any posts or comments.

Cheers

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@jsararas09authorFeb 21.2006 — Hi,

I guess I would use software out there to rename all files at once to lowercase.

How would I change all the html to the same lowercase filenames without going through each file?

Thanks
Copy linkTweet thisAlerts:
@ray326Feb 22.2006 — You can use wget to grab a copy of the whole site from the Windows server (if it's fully linked) and fix all the links. It will wind up doing that by using the Windows server to find the files regardless of case and save them with the case in the link. Of course if the links are as inconsistent as the files you'll wind up with duplicates on the new site but that can gradually be corrected manually.

Of course if you have a good editor and you're really good at regular expressions then you can blow through all the pages at once and lower case all the href values.
Copy linkTweet thisAlerts:
@chazzyFeb 22.2006 — i just want to clarify

in your HTML files, the links are all in lower case. however, the files themselves are mixed in upper/lowercase, correct?
Copy linkTweet thisAlerts:
@jsararas09authorFeb 22.2006 — all the files are mixed and in the html files, some links are all in lower case but some are both mixed.

example: some - thisfile.gif some - ThisFile.gif

I would like to change all these filenames in the html to lowercase, thisfile.gif or thispage.html but without doing it manually to each filename.


The client I'm working for just copied everything onto a usb drive and gave it to me. I don't have access to a windows server. I have just read a very little on regular expressions and have downloaded PowerGrep. I did a search using <a href=".+.htm"> and it came up with all the links to pages. I just don't know how to replace those found files with lowercase. Do you know the expression to use?

Thanks.
Copy linkTweet thisAlerts:
@ray326Feb 22.2006 — Do you know the expression to use?[/QUOTE]Not without a lot of trial and error. I can recommend the O'reilly book on mastering REs.

http://www.oreilly.com/catalog/regex2/index.html

Perl, awk and sed are other editing possibilities.
×

Success!

Help @jsararas09 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...