renaming only files with no extension

A swapping-ground for Regular Expression syntax

renaming only files with no extension

Postby psyctc » Tue Dec 13, 2005 2:22 am

I'm not bad at perl regexps but I'm thrown when the regexp style is slightly different. I'd like to rename a lot of files that don't have extensions to have an extension. I thought I could do something like:
(^[^\.]*$) and extension = convert and \1.jpg to get the ".jpg" extension on ... oops, well, I'll post this anyway as someone else may want to use this too. It seems to work!

Hm. Seemed to be something odd going on when I used it in combination with recursive travel down the directory tree. Some files got converted to xxxjpg rather than xxx.jpg I _THINK_ it was only in the last subdirectory but I'm tired and starting to wonder if I'm hallucinating or seeing optical illusions here so I'll hope someone else will check this out.

Brilliant program. Huge thanks Jim.

Chris
psyctc
 
Posts: 1
Joined: Tue Dec 13, 2005 1:48 am

Postby Admin » Tue Dec 13, 2005 7:01 pm

Hi,

Why not just choose to "append" and extension of .jpg, using the box at the bottom-right? That will do it all for you.



Jim
Admin
Site Admin
 
Posts: 2572
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions