Re: Ken's grep question about renaming files to lowercase

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 52598
interpreted = N
texte = Ken, Speaking of unanswered questions, I think I have a partial solution to grepping your file names, however, I think you'd have to use an Applescript to do this in BBEdit because grep alone can't perform a change case function easily to a matched string. If anyone else knows otherwise, please let me know. This is the logic (working syntax will vary) for how I'd approach it in WebDNA: 1. Match a filename using a regular expression such as ([0-9A-Za-z]+)\.(tpl|htm|html|dna|gif|jpg|png) You could turn off case sensitivity in WebDNA 5.0 so you wouldn't need to consider permutations of lower/uppercase characters. This assumes all file names are alphabetical or numerical characters only. 2. Replace it with the [lowercase]\1\.\2[/lowercase] of the match. You could do the same thing in Applescript, I just don't recall if there's a lowercase function as part of the default OSAX or if you need a special OSAX to do it. If you're using UNIX, you could use a shell script which may be easier to program for recursion, but I don't know how you'd lowercase the matching pattern in the shell. There's a tr command, but I'm not sure how to get it to operate on just the matching characters. Frankly I'd like to see a WebDNA solution to this because it has all of the components necessary except for easy file recursion. Bill ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Ken's grep question about renaming files to lowercase ( Kenneth Grome 2003)
  2. Re: Ken's grep question about renaming files to lowercase ( William DeVaul 2003)
  3. Re: Ken's grep question about renaming files to lowercase ( Alex McCombie 2003)
  4. Re: Ken's grep question about renaming files to lowercase ( Kenneth Grome 2003)
  5. Re: Ken's grep question about renaming files to lowercase ( devaulw@onebox.com 2003)
Ken, Speaking of unanswered questions, I think I have a partial solution to grepping your file names, however, I think you'd have to use an Applescript to do this in BBEdit because grep alone can't perform a change case function easily to a matched string. If anyone else knows otherwise, please let me know. This is the logic (working syntax will vary) for how I'd approach it in WebDNA: 1. Match a filename using a regular expression such as ([0-9A-Za-z]+)\.(tpl|htm|html|dna|gif|jpg|png) You could turn off case sensitivity in WebDNA 5.0 so you wouldn't need to consider permutations of lower/uppercase characters. This assumes all file names are alphabetical or numerical characters only. 2. Replace it with the [lowercase]\1\.\2[/lowercase] of the match. You could do the same thing in Applescript, I just don't recall if there's a lowercase function as part of the default OSAX or if you need a special OSAX to do it. If you're using UNIX, you could use a shell script which may be easier to program for recursion, but I don't know how you'd lowercase the matching pattern in the shell. There's a tr command, but I'm not sure how to get it to operate on just the matching characters. Frankly I'd like to see a WebDNA solution to this because it has all of the components necessary except for easy file recursion. Bill ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ devaulw@onebox.com

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

problems with 2 tags (1997) Smart caching problems with 2.1b3? (1997) Banner Ad example (Typhoon) and WebCatalog (1997) Paths, relative paths, webstar server setup and security (Mac) (1997) MOOOOOO (2000) WebCat2.0 [format thousands .0f] no go (1997) Quickie question on the email templates (1997) Logging purchases (1997) [isfile] ? (1997) [Sum] function? (1997) Almost a there but..bye bye NetCloak (1997) UPPERCASE (1997) maybe even an easier plan to satisfy need for solid tech support? (2000) showif field is number (1997) Re(2): Re(2): SSL, WebSTAR, WebCatalog (1998) Separate SSL Server (1997) Mac: [ListFiles] bug alert (1997) Not really WebCat (1997) RE: protect tag not working (1998) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997)