changing file names on the fly

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

changing file names on the fly

Eva Isotalo-2
Is there a way to alter file names in a directory (from a MC script, not manually)? :-)

I have hundreds of images of which the name has to be changed slightly.
For example:
anim1_Angle1.00_  9.png
must be changed to (space deleted):
anim1_Angle1.00_9.png

Eva

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: changing file names on the fly

Klaus on-rev
Hi Eva,

> Is there a way to alter file names in a directory (from a MC script, not manually)? :-)
>
> I have hundreds of images of which the name has to be changed slightly.
> For example:
> anim1_Angle1.00_  9.png
> must be changed to (space deleted):
> anim1_Angle1.00_9.png

yes, use the "rename" command:
Put the filename into a variable -> tFilenameOld
put tFileNameOld into tFileNameNew
Modify/fix it as needed:
set itemdel to "/"
replace " " with "" in item -1 of tFileNameNew
rename" file tFileNameOld to tFileNameNew

You get the picture :-)

> Eva

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: changing file names on the fly

Klaus on-rev
Correction:

Am 17.05.2011 um 15:46 schrieb Klaus on-rev:

> Hi Eva,
>
>> Is there a way to alter file names in a directory (from a MC script, not manually)? :-)
>>
>> I have hundreds of images of which the name has to be changed slightly.
>> For example:
>> anim1_Angle1.00_  9.png
>> must be changed to (space deleted):
>> anim1_Angle1.00_9.png
>
> yes, use the "rename" command:
> Put the filename into a variable -> tFilenameOld
> put tFileNameOld into tFileNameNew
> Modify/fix it as needed:
> set itemdel to "/"
> replace " " with "" in item -1 of tFileNameNew

## Of course withouth the single QUOTE
> rename file tFileNameOld to tFileNameNew

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: changing file names on the fly

Eva Isotalo-2
Great, thanks Klaus!

hugs
Eva



_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard