ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

REQUEST: Automated search and move tool

(1/2) > >>

KoenFugro:
Hello people!
I am a newbie on this forum 8)

Not new on the donationcoders.com website (love it)
For my work i have a job to do, witch is first of all very boring, second, it takes much time!

This is the problem:
I have folders witch contains 1000 folders, folders are named barcode style, ie: EBN0000012355 then EBN0000012356 etc.
Each folder contains a PDF file. These PDF files are created from tiff files. And these tiffs do have the same barcode folder name, but are standing in two different folders somewere on our SAN.

I need the Tiff's and the PDF files together. So now the steps I need to take:
1. Open the folder where i can see the folder listing of all the PDFS.
2. I copy a barcode name, the go to the 1st folder on the SAN to search, richt click, paste the barcode name, and perform a search.
3. Repeat the abobe step on the second folder on the SAN.

4. I move the folder witch comes out the search result to the dir. containing PDF's.
5. I do the same with the second search result.
6. I go back to step one.

This looks for me something that can be done asutomatically. (am i right?:-))
So, i am curious for some tips, maybe code, please help me! :tellme:

Kind regards,
Koen

ps.
I have allready tried some programs and stuff, did'nt work out..


skrommel:
 :) Here's an AutoHotkey script, almost untested.

If loops the local folder for dir names, searches the two san folders for a matching name, and moves it to the local folder.

Skrommel


--- ---localfolder=C:\PDFS                  ;local and target folder
sanfolder1=\\SAN\TIFS1            ;remote folder 1
sanfolder2=\\SAN\TIFS2            ;remote folder 2

Loop,%localfolder%\*,1            ;search through the local folder
{
  IfInString,A_LoopFileAttrib,D    ;look for folders
  {
    MOVE(A_LoopFileName,sanfolder1,A_LoopFileFullPath)  ;look for the folder in remote folder1
    MOVE(A_LoopFileName,sanfolder2,A_LoopFileFullPath)  ;look for the folder in remote folder2
  }
}
ExitAPP


MOVE(find,root,target)
{
  Loop,%root%\*,1            ;search through the remote folder
  {
    IfInString,A_LoopFileAttrib,D   ;look for folders
    If (A_LoopFileName=find)       ;if match
    {
      FileMoveDir,%A_LoopFileFullPath%,%target%\%find%   ;move the folder to the local folder
      Break
    }
  }
}

KoenFugro:
Hey!
Thx for the script!
Doesn;t work though...

I tried to debug, it seems to go wrong with the target and the MOVE command...

Can someone help me further with this?

Koen

skrommel:
 :-[ Found two small errors and changed the script above...

Skrommel

KoenFugro:
Thx!

The script now moves the TIFFS from san 1 folder to the root of PFD folder... but not the san 2 folder...

Can you post comment please with your code?
Then I can better understand what the program is doing..

How can i change the target where the tiffs are coming?

Thanks very much!
Koen

Navigation

[0] Message Index

[#] Next page

Go to full version