DonOetje
asked on
Move files from directory to directory with .BAT-File
Hi everyone,
I'm not that familiar with DOS and .BAT-Files. Thats the reason for this post. And i hope some one can help me solve this problem.
There is an Internet application where operators check check documents. Before that the operators check, the documents go trough 2 recognition engines. If the engines detect an ERROR they documents are placed in an map (maps or numbered from 1 to 200) in a special ERROR directory (see figure 1). The documents in the ERROR directory, must go back in the pipeline. I cant cut and paste, because that not efficient and there are parameters that need to be positive (see Figure 2). They have to be moved from ERROR to a special map into the input directory PDF. This map is also numbered from 1 to 200 (see Figure 3).
Parameters:
*User needs to give up an START and END date. Only the documents in that period need to be replaced.
*The minimum size of the documents. There or files of 0 Kb and those files need to stay in the error directory.
*Must give the amount that can be moved to a map into the PDF\1 map. For example the maximum of documents a map or 4000 documents. If the 4000 has been retched the next 4000 must bee moved to PDF\2 and so on.
*In a .TXT file must keep a log with the following information. Wich files have been copied and when.
Structure---ERROR-Directory.JPG
Documents-in-ERROR-Dir.JPG
Move-from-ERROR-dir-to-PDF.JPG
I'm not that familiar with DOS and .BAT-Files. Thats the reason for this post. And i hope some one can help me solve this problem.
There is an Internet application where operators check check documents. Before that the operators check, the documents go trough 2 recognition engines. If the engines detect an ERROR they documents are placed in an map (maps or numbered from 1 to 200) in a special ERROR directory (see figure 1). The documents in the ERROR directory, must go back in the pipeline. I cant cut and paste, because that not efficient and there are parameters that need to be positive (see Figure 2). They have to be moved from ERROR to a special map into the input directory PDF. This map is also numbered from 1 to 200 (see Figure 3).
Parameters:
*User needs to give up an START and END date. Only the documents in that period need to be replaced.
*The minimum size of the documents. There or files of 0 Kb and those files need to stay in the error directory.
*Must give the amount that can be moved to a map into the PDF\1 map. For example the maximum of documents a map or 4000 documents. If the 4000 has been retched the next 4000 must bee moved to PDF\2 and so on.
*In a .TXT file must keep a log with the following information. Wich files have been copied and when.
Structure---ERROR-Directory.JPG
Documents-in-ERROR-Dir.JPG
Move-from-ERROR-dir-to-PDF.JPG
this is something that I did for another user.
http:Q_24330834.html#a24232677 --- Instructions for running it on a schedule.
http:Q_24330834.html#a24165351 --- Code here
This uses RoboCopy.
Good Luck
Carrzkiss
http:Q_24330834.html#a24232677 --- Instructions for running it on a schedule.
http:Q_24330834.html#a24165351 --- Code here
This uses RoboCopy.
Good Luck
Carrzkiss
Never mind my post.
It can probably do what you need, but not without a lot of work.
I hope that the information from: Qlemo:
Will do what you need, it looks like it will.
Good Luck
Carrzkiss
It can probably do what you need, but not without a lot of work.
I hope that the information from: Qlemo:
Will do what you need, it looks like it will.
Good Luck
Carrzkiss
ASKER
Qlemo: Thank you for your solution. Butt i have a question. Where do you set the ERROR and PDF directory. The files must be moved vroom ERROR to PDF.
In your script i see in line 4 the main directory. "cd /D D:\Textkernel\Pipeline\xt_ input". In the for loop you give the wildcard *.pdf, this will search for all the docs in ERROR an in PDF. That is not suppose to happen.
Hope you understand what i mean.
In your script i see in line 4 the main directory. "cd /D D:\Textkernel\Pipeline\xt_
Hope you understand what i mean.
I understand well. And you are partitially right, I forgot to use the ERROR folder. The code above will not do anything, as it will search in xt_input only, no subdirs.+
Replace line 19 with
Replace line 19 with
for /F "tokens=*" %%F in ('dir *.pdf*') do if %%~zF GTR %minsize%
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much! It works well! At least if the date is well converted. The date can be written in two ways. mm/dd/yyyy an dd-mm-yyyy. That one of the reasons it didn't work.
On Server 2003 the date will always be written like this: mm/dd/yyyy?
Qlemo thank you very much for your solution!
On Server 2003 the date will always be written like this: mm/dd/yyyy?
Qlemo thank you very much for your solution!
ASKER
Thank you for providing me a solution. I tested the script on a XP machine with the date set as dd-mm-yyyy, on the server the date is set as mm/dd/yyyy. I think that there must be a date check, to be sure that the right conversion will be used.
Open in new window