extracted folder moving help needed

Discuss RoboTask here
Post Reply
merle
Posts: 15
Joined: Thu Sep 21, 2006 5:48 pm

extracted folder moving help needed

Post by merle »

hello Oleg here is what I am trying to do. I am having problems with step 3a and step 4 a-d.Can you help? I have been trying and have many little tasks that I use calling other task to do this but have trouble after the entire folder is extracted... to move entire folder and then delete that folder....  Thanks!1) monitor for file or folder creation e:\books
2) move all zip or rar or par2 files into a hold\sorting dir e:\hold
3) extract zip or rar files into the same directory (using winrar)  with each archive creating a separate folder (winrar does that automatically using C:\Program Files\WinRAR\WinRAR.exe e -ad *.* -INUL -O+ -IBCK (corrected winar command line)
    3a) if zip or rar has problem (corrupt, broken or password) stop winrar task and move problem archive to dir e:\problem files
4) after extract seach inside folder for txt, rtf or html or htm files
    4a) moves to dir e:\sorted with this criteria:
    4b) creates master folder named txt, or rtf or htm  
    4c) creates a new master folder underneath the folders in 4b based
off of the first two words in the folder name from step 3    
    4d) when moving to e:sorted it will look at folder created in step 3 and move the entire folder based on if the folder
    has a txt file to e:\sorted\txt\(folder name)
    has a rtf file to e:\sorted\rtf\(folder name)
    has a htm/html file to e:\sorted\htm\(folder name)
5) if encounter already named folder it overwrites it
6)deletes compressed archive
Last edited by merle on Wed Apr 11, 2007 3:10 am, edited 1 time in total.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

extracted folder moving help needed

Post by Oleg »

Let's be consecutive.
Regarding the point number 3:
I think you have to unpack each file separately in file loop. Like this

File loop // by *.zip, *.rar, *, par2 files
   run program C:\Program Files\WinRAR\WinRAR.exe e {current_file} -INUL -O+
end loop

Run program action you must use with "wait until the applocation exits" wait option. In this case you must save the exit code of WinRAR into variable and analyse it later.
When archive is broken WinRAR must return a non-zero exit code. It is possible to retrieve experimental, just try this action with broken archive. Maybe you can find this information in WinRAR documentation.
The task will look so:

File loop // by *.zip, *.rar, *, par2 files
   run program WinRAR //and store exit code to exit_code variable
   if {exit_code}<>0 then // probably broken
      ...
      do error handling
      ...
   else // Ok
      ...
      do normal steps
      ...
   endif
end loop
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

extracted folder moving help needed

Post by Oleg »

4c) creates a new master folder underneath the folders in 4b based off of the first two words in the folder name from step 3
Probably I haven't understood what folder did you mean?
merle
Posts: 15
Joined: Thu Sep 21, 2006 5:48 pm

extracted folder moving help needed

Post by merle »

Hi Oleg thanks as always for responding so quickly.My current problem that I am stuck on from above: is sorting out folders that have a [] in them. Example  folder called "Roman expansion in the western Mediterranean [doc]" as part of the folders nameI have tried the following as my search stringH:\sorted\*doc *.*H:\sorted\*doc*.*H:\sorted\*"[doc]"*.*H:\sorted\* [doc] *.*H:\sorted\*[doc] *.*h:\sorted\*'[doc]'*.*I am thinking the [] must be reserved for RT?I am working on it the project as we speak. Its to late for me to review what you have suggested, I will have to review it later and see if I can make it work. Oh and to all who may have read my earlier post on the winrar the correct command line is: e -ad *.* -INUL -O+ -IBCK not the e *.*  -INUL -O+I will edit my other post to correct this.
merle
Posts: 15
Joined: Thu Sep 21, 2006 5:48 pm

extracted folder moving help needed

Post by merle »

Hi Oleg to answer you question regarding my question.4c) creates a new master folder underneath the folders in 4b based off of the first two words in the folder name from step 3I believe this will do that{FileName_only(0)}, {FileName_only(1)}where RT after moving the folder called Example: "Pendas, Merle - Roman expansion in the western Mediterranean (doc)" as part of the folders name'that RT looks at folder name,  creates a folder under the dir: h:\sorted\doc that is named: Pendas, Merle.So I would end up with: H:\sorted\doc files\Pendas, Merle\Pendas, Merle - Roman expansion in the western Mediterranean (doc)so that the next folder that has the first word coma space 2nd word matching pendas, mele that it would drop it into the newly created folder as well. example Pendas, Merle - Expansion during the Early Roman Republic (doc)would end up as H:\sorted\doc files\Pendas, Merle\Pendas, Merle - Expansion during the Early Roman Republic (doc)I would after I get more proficient at the programming like for RT to do a search  any where in the folder name for the , and from there create the folder but I think that will be down the line. I plan on doing a presort on folders that do not have a last name, first name prior to step 4c to avoid creating a folder with a reserved  name or  special symbol.Unless you can suggest an easy way to do the search for the last name,  first name any place in the folder name.                 Thanks as always                
Post Reply