Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
78 user(s) are online (66 user(s) are browsing Forums)

Members: 0
Guests: 78

more...

Support us!

Headlines






Rename script request
Just popping in
Joined:
2015/9/29 0:42
From Bettendorf, IA, USA
Posts: 222
Hi, guys! Long time no chat.

I am looking for some help. I need a script to rename 600+ files. The filename has the date in it, I want to change the format.

mark_ritter_31072020_1628_xxxx_yyy.jpg

I want to change JUST the date format to:

mark_ritter_2020-07-31_1628_xxxx_yyy.jpg

leaving the rest of the filename the same. The date is in the same position for every filename.

I would like an ARexx or DOS script. Put it in the drawer. Execute it. It scans in all the names and renames them.

Thanks!!!

   Report Go to top

Re: Rename script request
Just popping in
Joined:
2007/1/10 21:56
From Stockholm Sweden
Posts: 179
I wanted to do the same thing back in 2010 on A1XE with lots of photos and I succeded in doing so, but can I can't remeber exactly what i did..

Have some memory of making a Directory Opus script.. But can't find it on my X5000..

_________________
1989-> A500, A600, A3000, A4000, A1200, CD32, µA1, PegII, A1XE, CDTV, Amy/416D79, A1X5000, Vampire 500 V2+, Vampire 600 V2, Amy-ITX<-2021
   Report Go to top

Re: Rename script request
Home away from home
Joined:
2006/11/26 21:45
From a dying planet
Posts: 4160
@mritter0

Tested on a two file list, haven't had the will to create more files
*NOT* optimized!

/* */

ADDRESS COMMAND 'list mark#? lformat="%n" >filelist.txt'

OPEN(fl,'filelist.txt','R')

DO WHILE ~
EOF(fl)
    
fn=READLN(fl)
    
/*
    Catch empty lines and skip them
    */
    
IF fn~=' ' THEN DO
        
fn_date=SUBSTR(fn,13,8)
        
fn_date_day=SUBSTR(fn_date,1,2)
        
fn_date_month=SUBSTR(fn_date,3,2)
        
fn_date_year=SUBSTR(fn_date,5,4)
        
fn_date=fn_date_year'-'fn_date_month'-'fn_date_day
        fn_new
=INSERT('..',fn,13,2)
        
fn_new=OVERLAY(fn_date,fn_new,13)
        
ADDRESS COMMAND 'rename 'fn' as 'fn_new
    END
END

CLOSE 
(fl)
ADDRESS COMMAND 'delete filelist.txt'

EXIT 0

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: Rename script request
Just popping in
Joined:
2015/9/29 0:42
From Bettendorf, IA, USA
Posts: 222
@Raziel

Thank you! Worked perfectly! Appreciate it!

   Report Go to top

Re: Rename script request
Home away from home
Joined:
2006/11/26 21:45
From a dying planet
Posts: 4160
@mritter0

yw, was fun to knock it together quickly

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: Rename script request
Site Builder
Joined:
2006/12/2 23:57
From Athens/Dublin
Posts: 881
Have you guys tried MultiRen?

https://www.onyxsoft.se/multiren.html

   Report Go to top





[Advanced Search]



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project