move and rename

Discuss and share scripts and script files...
Post Reply
calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

move and rename

Post by calude »

Hi
sorry bothering you for a simple 2 line script

what I would like is
1- select one file (google.csv)
run script
the files gets moved to a folder already populated by
google_contacts_all_02.csv
google_contacts_all_03.csv
google_contacts_all_04.csv
google_contacts_all_05.csv
google_contacts_all_06.csv
google_contacts_all_07.csv

and the file gets renamed you guess it
google_contacts_all_08.csv

next time I do the script
google_contacts_all_09.csv

Have tried several times
with
moveto and then rename or renameitem
or the other way around

as I'm not a scripter, I used trial and error and went nowhere

thanks for helping me solving this

Calude

Code: Select all

moveto D:\CV_mes_documents\Document\google_contact_backs\
 renameitem("google_contacts_all_", , , "01");

highend
Posts: 14942
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: move and rename

Post by highend »

Create a dummy entry in that folder named
"google_contacts_all.csv"

and use:
renameitem("google_contacts_all", , , "_01");
One of my scripts helped you out? Please donate via Paypal

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: move and rename

Post by calude »

Hi thanks helping me

tried your "dummy" suggestion and got an error:
Dépassement de capacité
0 \ 0

(overflow) I guess

Calude


Code: Select all

 moveto D:\CV_mes_documents\Document\google_contact_backs\
 renameitem("google_contacts_all", , , "_01");

highend
Posts: 14942
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: move and rename

Post by highend »

Change your paths...

Code: Select all

setting('BackgroundFileOps', 0);
 $item = "<curname>";
 moveto "D:\temp\";
 renameitem("google_contacts_all", "D:\temp\".$item, , "_01");
One of my scripts helped you out? Please donate via Paypal

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: move and rename

Post by calude »

highend
thanks a lot
works perfect

Have a nice Day

Calude

Post Reply