Hello all,
I did a search on the forum and was unable to find an old topic on this.
I would like to go to the HaidProduction director with greater then 3000 main folders. In each main folder there are 4 sub folders. One of the sub-folder are called Modelling. I want to go into that folder and pull out *_ModellingTreeOut.txt file between a specific date of creation. Then I want to write the main folder name and the text file name to another text file. Is this possible to do with Macro Scheduler program or is there an easy way to get this information?
R:\ HaidProduction\Batch10-26-04-CC-Gr5\Modelling\*_ModellingTreeOut.txt
Batch has over 3000 folders in Haidproducation.
Modelling folder is always found in Batch folder.
1508L_ModellingTreeOut.txt - this file always has number then L or R then _ModellingTreeOut.txt as its name.
Thanks
Mike
File creation between a specific date
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
You can try something like this untested outline of a script. Will need to make variable for mm/dd/yyyy that you want.
This is just a rough outline to give you some ideas. It will definitely need to be modified.Let>FolderName=R:\ HaidProduction\Batch10-26-04-CC-Gr5\Modelling
GetFileList>%FolderName%\*_ModellingTreeOut.txt,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>k=k+1
GetFileDate>thisdate
If>%thisdate%>mm/dd/yyyy,WriteFile
Until>k,file_names_count
SRT>WriteFile
WriteLN>c:\path\folder\filelist.txt,%FolderName%\file_names_%k%
END>WriteFile
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
R:\HaidProduction\Batch10-26-04-CC-Gr5\Modelling\*_ModellingTreeOut.txt
Drive\HaidProductionRootFolder\MainFolder\SubFolder\Files
Btw: let's get Bob's approval
Eh, untested. 
Drive\HaidProductionRootFolder\MainFolder\SubFolder\Files
The smilie in the above code occurs cause the forum isn't able to display DOS' dir argument /A: D correctly (you've to eliminate the space char right from the colon).Let>COMSPEC=cmd.exe
Let>MTODay=15
Let>MTOMonth=08
Let>HaidProductionRootFolder=R:\HaidProduction
Let>MainFolderList=C:\HaidProductionBatchFolderIndex.txt
Let>SubFolder=Modelling
Let>OutputFile=C:\HaidProduction\MTOs_%MTODay%%MTOMonth%.txt
Let>RP_WAIT=1
Run Program>%COMPSPEC% /C dir %HaidProductionRootFolder% /A:D /B > %MainFolderList%
Let>k=0
Label>start
Add>k,1
ReadLn>%MainFolderList%,k,MainFolder
If>%MainFolder%=##EOF##,finish
IfFileExists>%HaidProductionRootFolder%\%MainFolder%\%SubFolder%\%MTODay%%MTOMonth%L_ModellingTreeOut.txt,LFile
IfFileExists>%HaidProductionRootFolder%\%MainFolder%\%SubFolder%\%MTODay%%MTOMonth%R_ModellingTreeOut.txt,RFile
Goto>start
Label>RFile
Let>FoundFile=%MTODay%%MTOMonth%R_ModellingTreeOut.txt
Goto>WriteModellingTreeOutIndex
Label>LFile
Let>FoundFile=%MTODay%%MTOMonth%L_ModellingTreeOut.txt
Label>WriteModellingTreeOutIndex
WriteLn>%OutputFile%,result,%MainFolder% - %FoundFile%
Goto>start
Label>finish
MessageModal>Done!
ExecuteFile>%OutputFile%
Btw: let's get Bob's approval


- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
You da man Lumumba! Another super job
Great that you made the time for Mirdurern.
Only two items I would comment on. The first has nothing to do with original problem. Just a suggestion for all Macro Scheduler scripts that need COMSPEC with Run Program> command::
1. Maybe create COMSPEC based on variable:
2. Could also consider using Input> to prompt for MTODay, MTOMonth values
--------------------------
I was looking at File Date, and you are using the date within the file name. Don't know if they are the same, but at least he has a few options to consider. And at least your option has some real code vs. outline.
:idea:I think I will send you my own outlines in the future and have you do the coding for me, hmmmmm, GREAT IDEA!

Great that you made the time for Mirdurern.
Only two items I would comment on. The first has nothing to do with original problem. Just a suggestion for all Macro Scheduler scripts that need COMSPEC with Run Program> command::
1. Maybe create COMSPEC based on variable:
----------------------MidStr>%OS_VER%,1,2,OS
If>%OS%=95,WIN9X,NT
Label>WIN9X
Let>COMSPEC=Command.com
Goto>Start
Label>NT
Let>COMSPEC=Cmd.exe
Label>Start
2. Could also consider using Input> to prompt for MTODay, MTOMonth values
--------------------------
I was looking at File Date, and you are using the date within the file name. Don't know if they are the same, but at least he has a few options to consider. And at least your option has some real code vs. outline.
:idea:I think I will send you my own outlines in the future and have you do the coding for me, hmmmmm, GREAT IDEA!

Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
@ Bob
) But, a good chance that it's complete rubbish

My assumption was based on that. We use something similar. Its more intuitive for SuperNoobs (those who have disabled the "Details" option in the Explorer1508L_ModellingTreeOut.txt - this file always has number then L or R then _ModellingTreeOut.txt as its name


I assume you're correct !... between a specific date of creation

I had the idea that your suggestion is limited to that one Main-/BatchFolder.Let>FolderName=R:\ HaidProduction\Batch10-26-04-CC-Gr5\Modelling

Thank you!
Thank you all for the great help.
Mirdurern
Mirdurern