Complex file moving puzzle ...

Discuss RoboTask here
Post Reply
Can You Help?
Posts: 5
Joined: Fri Oct 29, 2004 4:39 pm
Location: Antarctica

Complex file moving puzzle ...

Post by Can You Help? »

Hi, I like this proggy but I have a problem you might be able to help with:
I have the following structure, all file types within the folders are the same, but with different filenames:
Folder 1 (contains a random number of files)
Folder 2 (contains a random number of files)
Folder 3 (contains a random number of files)
etc up to Folder 12
and I want to make Robotask, on the press of a hotkey, a file (the top most one alphabetically will do fine) from each of Folders 1 to 12 into New Folder A ... and then (still automatically as part of the same task) go back and copy a different file from Folders 1, 2, 3 etc to 12 into New Folder B. It would be nice if the New Folders were created by Robotask when the move to the new folder is made.
The task would stop when there were no files left to move.
I realise this is quite complex, but this problem is really beginning to frustrate me.
Hope I explained this OK, let me know if you need any more info. If you are able to answer this, but just need some time, please post to let me know this.
Thanks.
Last edited by Can You Help? on Fri Oct 29, 2004 9:00 pm, edited 1 time in total.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Complex file moving puzzle ...

Post by Oleg »

Sorry, it's not clear. What files we need to copy from folder1 (2,3,....12) to NewFolderA, all or by some criteria? What is a different file from folder1 (2,3,....12)? What files we need to compare? Describe in detail, please.

I understood so: into folder NewFolderA we need to copy all files from folder1 (2,3,....12). And we need to copy into NewFolderB files, which exists in NewFolderA, but not exists in folder1. And so on for folder2, .... folder12.
But I think that I can be mistaken.
Can You Help?
Posts: 5
Joined: Fri Oct 29, 2004 4:39 pm
Location: Antarctica

Complex file moving puzzle ...

Post by Can You Help? »

Hi Oleg, thanks for the response, I will make it clearer as I thought my first post was a bit vague. Please forget the above as I have found a way to reorganise the files to try to make it easier to accomplish the task.
I now have the following structure:
One Folder with lots of files in it (the precise number will vary from time to time). The filenames all have one of the following prefixes:
1A_
2A_
... up to 12A.
So for example, one filename might be 5A_blahblah.doc, another might be 7A_something.doc
I want Robotask, on the click of a hotkey, to perform a process where the result I end up with is that many New Folders are created on the same drive and inside each of these New Folders will be one of each of the 1A_ 2A_ ... to 12A_ files.
It does not matter which of the 1A_ , 2A_ files are copied but it does matter that only one of each is copied. The files could be determined by any suitable criteria that means only one file is copied. For your information, the part of the filename after the prefix will always be different from other files in the folder.
I hope this makes it easier and clearer. I appreciate your help Oleg.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Complex file moving puzzle ...

Post by Oleg »

Hm-m.
Generally speaking it's not difficult. You should use the File Loop, but break it after copying of first file.
See example below.

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|850444931
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task181"
Hide=INTEGER|0
ID=INTEGER|1484876710
Name=STRING|"Copy first file demo"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER

[Actions\Action1]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20041030"
date2=STRING|"20041030"
destvar=STRING|"CURFILE"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"c:\Source\1a_*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action2\Params]
destdir=STRING|"c:\dest"
f_count=STRING|"1"
file0=STRING|"{curfile}"
ifexists=STRING|"1"
move=STRING|"0"
subdir=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"

[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action5]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action5\Params]
createmode=STRING|"1"
date1=STRING|"20041030"
date2=STRING|"20041030"
destvar=STRING|"CURFILE"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"c:\source\2a_*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action6]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action6\Params]
destdir=STRING|"c:\dest"
f_count=STRING|"1"
file0=STRING|"{curfile}"
ifexists=STRING|"1"
move=STRING|"0"
subdir=STRING|"0"

[Actions\Action7]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"

[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"


Last edited by Oleg on Sat Oct 30, 2004 11:53 am, edited 1 time in total.
Can You Help?
Posts: 5
Joined: Fri Oct 29, 2004 4:39 pm
Location: Antarctica

Complex file moving puzzle ...

Post by Can You Help? »

OK Oleg, I will try this - but what do I do, copy and paste the above text and then save it as a .txt file and import it into Robotask? Sorry if this is a silly question but I am new to this really
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Complex file moving puzzle ...

Post by Oleg »

In order to import this task into RoboTask save text of the task to file (any filename) and use menu command "Task | Import".
Can You Help?
Posts: 5
Joined: Fri Oct 29, 2004 4:39 pm
Location: Antarctica

Complex file moving puzzle ...

Post by Can You Help? »

I think we are almost there Oleg, but it is not working yet. Here is what I have done:
As a test I created D:\folder with 1A_test1.txt and 1A_test2.txt and 2A_test1.txt and 2A_test2.txt files inside it.
I also created D:\newfolder1 and D:\newfolder2
(I want the task to copy 1A_test1.txt and 2A_test1.txt D:\newfolder1 & 1A_test2.txt and 2A_test2.txt to D:\newfolder2)
I imported the file and went to edit the COPY FILE part. I set the first COPY FILE part of the loop to the D:\newfolder1 destination and the second part to D:\newfolder2 detination.
I set the hotkey to Ctrl+P and enabled the action.
I did not know what to put in the part that says {curfile} - I tried D:\folder1\*.txt but nothing happened.
I'm too much of a newbie to get this working it seems. Can you point out where I am going wrong?
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Complex file moving puzzle ...

Post by Oleg »

Look at File Loop action. If you use different folders you should change the File loop settings too. In your case you need to type d:\folder1\1a_*.* and d:\folder1\2a_*.* correspondingly. Variable CurFile will be assigned in File Loop action (see settings of File Loop).
Don't forget to activate your task. If task is inactive the triggering event (in your case the HotKey) don't work.
Last edited by Oleg on Sun Oct 31, 2004 9:40 am, edited 1 time in total.
Can You Help?
Posts: 5
Joined: Fri Oct 29, 2004 4:39 pm
Location: Antarctica

Complex file moving puzzle ...

Post by Can You Help? »

Hmmm, still not working, it seems that all files from the source folders are being copied to the new folder, as opposed to one of each. I have exported the task here so you can see what is wrong:
;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2091259954
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task1"
Hide=INTEGER|0
ID=INTEGER|237976659
Name=STRING|"Copy first file demo (imported)"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
[Actions\Action1]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER
[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20041030"
date2=STRING|"20041030"
destvar=STRING|"CURFILE"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"d:\folder\1A_*.*"
file1=STRING|"d:\folder\2A_*.*"
filecount=STRING|"2"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"
[Actions\Action2]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER
[Actions\Action2\Params]
destdir=STRING|"D:\newfolder"
f_count=STRING|"3"
file0=STRING|"{curfile}"
file1=STRING|"d:\folder\1A_*.*"
file2=STRING|"d:\folder\2A_*.*"
ifexists=STRING|"1"
move=STRING|"0"
subdir=STRING|"0"
[Actions\Action3]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action5]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER
[Actions\Action5\Params]
createmode=STRING|"1"
date1=STRING|"20041030"
date2=STRING|"20041030"
destvar=STRING|"CURFILE"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"d:\folder\1A_*.* "
file1=STRING|"d:\folder\2A_*.*"
filecount=STRING|"2"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"
[Actions\Action6]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER
[Actions\Action6\Params]
destdir=STRING|"D:\newfolder2"
f_count=STRING|"3"
file0=STRING|"{curfile}"
file1=STRING|"d:\folder\1A_*.*"
file2=STRING|"d:\folder\2A_*.*"
ifexists=STRING|"1"
move=STRING|"0"
subdir=STRING|"0"
[Actions\Action7]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Events]
Event1=FOLDER
[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_GENERAL_HOTKEY"
Params=FOLDER
[Events\Event1\Params]
hotkey=STRING|"16464"
 
 
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Complex file moving puzzle ...

Post by Oleg »

Your task is wrong.
This task contains two loops. First loop must be on d:\folder\1A_*.* files, second loop - on d:\folder\2A_*.* files. If you have 12 groups of files you should have 12 loops.
In copy file action you don't need to specify strings d:\folder\1A_*.* and d:\folder\2A_*.*. It must contain only {curfile}, i.e. the current file name in loop.

I has corrected your task. See below.

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|850444931
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task182"
Hide=INTEGER|0
ID=INTEGER|1318132178
Name=STRING|"Copy first file demo (1)"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER

[Actions\Action1]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20041030"
date2=STRING|"20041030"
destvar=STRING|"CURFILE"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"d:\folder\1A_*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action2\Params]
destdir=STRING|"D:\newfolder"
f_count=STRING|"1"
file0=STRING|"{curfile}"
ifexists=STRING|"1"
move=STRING|"0"
subdir=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"

[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action5]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action5\Params]
createmode=STRING|"1"
date1=STRING|"20041030"
date2=STRING|"20041030"
destvar=STRING|"CURFILE"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"d:\folder\2A_*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action6]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action6\Params]
destdir=STRING|"D:\newfolder2"
f_count=STRING|"1"
file0=STRING|"{curfile}"
ifexists=STRING|"1"
move=STRING|"0"
subdir=STRING|"0"

[Actions\Action7]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"

[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_GENERAL_HOTKEY"
Params=FOLDER

[Events\Event1\Params]
hotkey=STRING|"16464"
Post Reply