I need to pick up from a different path each day, so I need to have paths like
//SERVER/PathToRoot/ddmmyy
ddmmyy should be today’s date
I see I can use %Header:xxxx% but I think that will only work for sending out file, not collecting files.
Is there a way to set a Header when collecting files?
Are there any examples using a script and fileListDir ?
Page 1 / 1
Hi @russell-jerseypost,
If you are looking to pickup file from subfolders named specifically after the current date, you should be able to use the DateFormat macro in the directory Path that your File Connector is going to be interacting with. For your example it may be something like:
//SERVER/PathToRoot/%DateFormat:ddMMyy%
This would pick up files from my 130723 subfolder as of the writing of this reply and it would start looking for files in the 140723 subfolder the following day.
Regarding a sample script for fileListDir operation I have drafted up a simple script that will read through the files in a directory, count them, and output them into the Arc script connector, hopefully this helps:
<!--Set the path to read from and initialize counter--> <arc:set attr="dir.path" value="C:\YourPath" /> <arc:set attr="total.counter" value="0"/> <!--Call operation, increment counter for each file in path, push each file to script connector output--> <arc:call op="fileListDir" item="dir"> <arc:set attr="total.counter" value="utotal.counter | add]" /> <arc:set attr="temp.filename" value="udir.file:name]"/> <arc:set attr="temp.filepath" value="udir.file:fullname]"/> <arc:push item="temp" /> </arc:call> <!--Output total count of files in the directory as an empty file--> <arc:set attr="total.filename" value="There were etotal.counter] files"/> <arc:push item="total"/>