Ignore files in root dir
- Verified User
- Posts: 14
- Joined: Tue May 26, 2009 8:54 am
the black text are the directories and the blue text are the files, these are all under the same parent directory.
How can exclude just the files in blue?
850_061665964NC 10/2/12 5:41:00 PM 0
852_061665964NC 10/2/12 5:41:00 PM 0
EDI_INVRPT_D_01B_UN_EAN006_1 10/2/12 5:41:00 PM 0
EDI_INVRPT_D_96A_UN_EAN004_1 10/2/12 5:41:00 PM 0
EDI_ORDERS_D_93A_UN_EAN007_1 10/2/12 5:41:00 PM 0
EDI_ORDERS_D_96A_UN_EAN008_1 10/2/12 5:41:00 PM 0
EDI_ORDERS_D_96A_UN_EAN008_42 10/2/12 5:41:00 PM 0
EDI_SLSRPT__901_EN_EAN001_1 10/2/12 5:41:00 PM 0
EDI_SLSRPT_D_93A_UN_EAN003_1 10/2/12 5:41:00 PM 0
EDI_SLSRPT_D_96A_UN_EAN004_1 10/2/12 5:41:00 PM 0
EDI_SLSRPT_D_96A_UN_EAN004_1_RINASCENTE 10/2/12 5:41:00 PM 0
EDIWIN-SOURCE-FILE 10/2/12 5:41:00 PM 0
1209261628020193972000-061665964NC-852_061665964NC-0 10/2/12 5:39:00 PM 12.76
1209261628095702694000-061665964NC-852_061665964NC-0 10/2/12 5:39:00 PM 1.58
1209261828352132171000-061665964NC-850_061665964NC 10/2/12 5:38:00 PM 2.75
1209271828442097749000-061665964NC-850_061665964NC 10/2/12 5:38:00 PM 4.3
1209281430099632668000-061665964NC-852_061665964NC-0 10/2/12 5:39:00 PM 13.99
- Support Specialist
- Posts: 592
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
Just change the "InboundFolder" variable at the end of this script to the folder you want to read (recursive). This will read all files in the InboundFolder and below... but, only print the status of the files that are not in the InboundFolder.
<project name="RootFile Test" mainModule="Main" version="2.0" threadSafe="false">
<module name="Main">
<createFileList label="Get Local FileList" fileListVariable="FilesToProcess" numFilesFoundVariable="NoFilesToProcess" version="1.0">
<fileset dir="${ InboundFolder }" recursive="true">
<wildcardFilter>
<include pattern="*" caseSensitive="false" />
</wildcardFilter>
</fileset>
</createFileList>
<forEachLoop label="Process Files Found" itemsVariable="${FilesToProcess}" currentItemVariable="ThisFile">
<setVariable label="RootFolderFile" name="RootFolderFile" value="${ Concat( InboundFolder, '\', ThisFile:name ) }" version="1.0" />
<print label="Compare" version="1.0">
<![CDATA[
================================================================================
** File Path Compare **
${ RootFolderFile }
${ ThisFile:path }
================================================================================
]]>
</print>
<if condition="${ ThisFile:path ne RootFolderFile }">
<print label="Not in Root Folder" version="1.0">
<![CDATA[
================================================================================
** This file is not in the Root Folder **
${ ThisFile:path }
================================================================================
]]>
</print>
</if>
</forEachLoop>
</module>
<variable name="InboundFolder" value="C:\MyFolder" description="Root Folder to Read" />
<description>Check to see if file is in Root Folder</description>
</project>
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696