Re: Removing a space from file name

2025-02-19 Thread Smoot Carl-Mitchell via beginners
On Thu, 2025-02-20 at 08:01 +0800, walt via beginners wrote: > > > > Something like: > > > > while (<*>) { > > rename $_, "$1$2.jpg" if $_ =~ /(.+) (.+)\.jpg/; > > } > > > > what does <*> mean here? <*> iterates over the current directory and returns every filename in the directory to the

Re: Removing a space from file name

2025-02-19 Thread walt via beginners
On 2025-02-18 04:12, Smoot Carl-Mitchell via beginners wrote: On Mon, 2025-02-17 at 12:38 -0500, hput wrote: I have several hundred *.jpg files with this pattern Actual example:    'AtlantaVisitAndGrandmaHands 056.jpg' The numbers vary, of course, but the alpha part and number of digits after

Re: Removing a space from file name

2025-02-17 Thread Smoot Carl-Mitchell via beginners
On Mon, 2025-02-17 at 12:38 -0500, hput wrote: > I have several hundred *.jpg files with this pattern > > Actual example: > >    'AtlantaVisitAndGrandmaHands 056.jpg' > > The numbers vary, of course, but the alpha part and number of digits > after the space is the same in all *.jpg files > > I

Re: Removing a space from file name

2025-02-17 Thread Mike Hübschen via beginners
Hello, Try something like this: rename 's/(.*?)\s(\d+).jpg$/$1$2.jpg/' *.jpg But make a backup first. Best regards, Mike On 2/17/25 18:38, hput wrote: I have several hundred *.jpg files with this pattern Actual example: 'AtlantaVisitAndGrandmaHands 056.jpg' The numbers vary, of course