Re: Renaming with a specific spec

2011-02-04 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> On 11-02-04 02:22 PM, Uri Guttman wrote: >> this comes from 35 years of coding and 18 years of perl. it isn't >> something i just came up with last week and it is also a common convention >> thing in perl so it is best to stick with that style. th

Re: Renaming with a specific spec

2011-02-04 Thread Shawn H Corey
On 11-02-04 02:22 PM, Uri Guttman wrote: this comes from 35 years of coding and 18 years of perl. it isn't something i just came up with last week and it is also a common convention thing in perl so it is best to stick with that style. there are plenty of conventions in perl coding and using // f

Re: Renaming with a specific spec

2011-02-04 Thread Uri Guttman
> "JD" == John Delacour writes: JD> At 13:00 -0500 04/02/2011, Uri Guttman wrote: HP> Yet they seem to be carefully avoided. That is what I nearly always HP> use. Is there some reason to avoid `//' as delimiters? JD> [ I really object to the backtick being used instead of an openin

Re: Renaming with a specific spec

2011-02-04 Thread John Delacour
At 13:00 -0500 04/02/2011, Uri Guttman wrote: HP> Yet they seem to be carefully avoided. That is what I nearly always HP> use. Is there some reason to avoid `//' as delimiters? [ I really object to the backtick being used instead of an opening quote mark. The only possiblt excuse for i

Re: Renaming with a specific spec

2011-02-04 Thread Brandon McCaig
On Fri, Feb 4, 2011 at 12:43 PM, Harry Putnam wrote: > I notice that in the OPs code and in your examples, the forward slash > is not used at all When you say above that "all the normal > delimiters [...]" .. but forward slashes `//' do not have special > meaning inside and would seem then to

Re: Renaming with a specific spec

2011-02-04 Thread Uri Guttman
> "HP" == Harry Putnam writes: HP> Jim Gibson writes: >> On 2/4/11 Fri Feb 4, 2011 8:02 AM, "Harry Putnam" >> scribbled: >> You can use other characters to make it more readable. However, all >> of the normal delimiters such as {} and [] have other meanings >> within the regu

Re: Renaming with a specific spec

2011-02-04 Thread Harry Putnam
Jim Gibson writes: > On 2/4/11 Fri Feb 4, 2011 8:02 AM, "Harry Putnam" > scribbled: > >> >> One further question. In your formulation shown below: >> , >> | unless($filename =~ m(.+\.(bmp|gif|jpg|png|psd|tga|tif)$)) >> | { >> | print STDERR "The filename {$filename} has

Re: Renaming with a specific spec

2011-02-04 Thread Jim Gibson
On 2/4/11 Fri Feb 4, 2011 8:02 AM, "Harry Putnam" scribbled: > > One further question. In your formulation shown below: > , > | unless($filename =~ m(.+\.(bmp|gif|jpg|png|psd|tga|tif)$)) > | { > | print STDERR "The filename {$filename} has an unsupported > | extension. Sk

Re: Renaming with a specific spec

2011-02-04 Thread Harry Putnam
Brandon McCaig writes: > On Thu, Feb 3, 2011 at 4:59 PM, Harry Putnam wrote: >> May I ask how that formulation servers the purpose better?  Is it >> processed more easily or quicker in that formulation as against the >> one I posted? >> >> Or does mine leave too many possibilities for poor resul

Re: Renaming with a specific spec

2011-02-03 Thread Brandon McCaig
On Thu, Feb 3, 2011 at 4:59 PM, Harry Putnam wrote: > May I ask how that formulation servers the purpose better?  Is it > processed more easily or quicker in that formulation as against the > one I posted? > > Or does mine leave too many possibilities for poor results? Yours just wasn't very prec

Re: Renaming with a specific spec

2011-02-03 Thread Harry Putnam
Jim Gibson writes: > This line assigns an upper-case letter to $d if $d has a value greater > than or equal to 10. A value of 10 is replaced by 'A', 11 by 'B', etc. > > $d = chr($d + ord('A') - 10) if $d >= 10; > > You can try changing that 'A' to 'a' and see what you get. I haven't > tried t

Re: Renaming with a specific spec

2011-02-03 Thread Harry Putnam
Brandon McCaig writes: > On Thu, Feb 3, 2011 at 10:47 AM, Harry Putnam wrote: >> I used this in my crude little starter program as one part of a >> foreach loop: >> >>  if ( !/^.*\.[bjgtp][gimnps][gfadp]$/) { >>    print "<$_> is not a properly named image file .. skipping\n"; >>    next; >>  }

Re: Renaming with a specific spec

2011-02-03 Thread Brandon McCaig
On Thu, Feb 3, 2011 at 10:47 AM, Harry Putnam wrote: > I used this in my crude little starter program as one part of a > foreach loop: > >  if ( !/^.*\.[bjgtp][gimnps][gfadp]$/) { >    print "<$_> is not a properly named image file .. skipping\n"; >    next; >  } > > Just so I'd have output so as

Re: Renaming with a specific spec

2011-02-03 Thread Jim Gibson
At 9:47 AM -0600 2/3/11, Harry Putnam wrote: Rob Dixon writes: Hey Harry As Jim says, there is very little chance that you will find an existing module that conforms to such a tight specification, but such a facility is trivial to write. Take a look at the program below and see if it >

Re: Renaming with a specific spec

2011-02-03 Thread Harry Putnam
Rob Dixon writes: > Hey Harry > > As Jim says, there is very little chance that you will find an existing > module that conforms to such a tight specification, but such a facility > is trivial to write. Take a look at the program below and see if it > helps you with a solution. [...] Skipped nif

Re: Renaming with a specific spec

2011-02-02 Thread Dr.Ruud
On 2011-02-01 03:41, Harry Putnam wrote: Can anyone suggest a tool they know to be capable of the above? Get inspired by the rename script, that comes with every perl installation. http://search.cpan.org/~rmbarker/File-Rename/rename.PL -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr..

Re: Renaming with a specific spec

2011-02-01 Thread Harry Putnam
Jim Gibson writes: [...] "John W. Krahn" writes: [...] Rob Dixon writes: [...] I had roughed out something that worked (sort of) and so found some of the problems that come up (such as overwriting). With the excellent input provided from the above cited posts, I can now manage a pretty ni

Re: Renaming with a specific spec

2011-02-01 Thread Rob Dixon
On 01/02/2011 02:41, Harry Putnam wrote: Looking for a renaming tool with certain capabilities, but when googling or searching cpan its quite hard to tell if the tool can or not satisfy them. So, I hope someone can tell me right off the top of their head if there is a renaming tool on cpan or an

Re: Renaming with a specific spec

2011-01-31 Thread John W. Krahn
Jim Gibson wrote: You are not likely to find such a specific tool. However, you can develop your own tool. Here is a renaming program adapted from the one in the Perl Cookbook, Recipe 9.9: #!/usr/bin/perl # # rename # # perl script to rename files # # Usage: # # rename perlexpr [files] # ($op

Re: Renaming with a specific spec

2011-01-31 Thread Jim Gibson
At 8:41 PM -0600 1/31/11, Harry Putnam wrote: Looking for a renaming tool with certain capabilities, but when googling or searching cpan its quite hard to tell if the tool can or not satisfy them. So, I hope someone can tell me right off the top of their head if there is a renaming tool on cpan