MattW76 wrote:Code: Select all
echo located !files! files in total>>"%temp%\filterEOD2.tmp"
Matt, is that the line you want the date and time in?
Do you want the current date and time?
Moderator: DosItHelp
MattW76 wrote:Code: Select all
echo located !files! files in total>>"%temp%\filterEOD2.tmp"
Code: Select all
EODMESS_20150930_1076295166.xml Date & Time
.....
Other files
.....
EODMESS_20150930_1076295166.xml Date & Time
located 6006 files in total
Code: Select all
@echo off
set "xmlpath=\\Server1\developer\inetpub\Ftproot\XMLs\*.xml"
dir /o:-d "%xmlpath%" |find "/" >"%temp%\filterEOD.tmp"
set "found="
set "files="
setlocal enabledelayedexpansion
(
for /f "usebackq tokens=1,2,3,4,*" %%a in ("%temp%\filterEOD.tmp") do (
set "f3=%%e"
echo %%e %%a %%b %%c
set /a files+=1
IF /i "!f3:~0,3!" EQU "EOD" IF defined found (
echo(
echo located !files! files in total
echo(
goto :out
)
IF /i "!f3:~0,3!" EQU "EOD" set "found=1"
)
)>"%temp%\filterEOD2.tmp"
:out
start "Filter EOD Files" "%temp%\filterEOD2.tmp"
del "%temp%\filterEOD.tmp"
Code: Select all
@echo off
set "xmlpath=\\server1\developer\inetpub\Ftproot\XMLs\*.xml"
dir /o:-d "%xmlpath%" |find ":" |find /v "\" >"%temp%\filterEOD.tmp"
set "found="
set "files="
setlocal enabledelayedexpansion
(
for /f "usebackq tokens=1,2,3,4,*" %%a in ("%temp%\filterEOD.tmp") do (
set "f3=%%e"
echo %%e %%a %%b %%c
set /a files+=1
IF /i "!f3:~0,3!" EQU "EOD" IF defined found (
echo(
echo located !files! files in total
echo(
goto :out
) ELSE (
If !Found! NEQ 1 Echo Only One EOD file found
)
IF /i "!f3:~0,3!" EQU "EOD" set "found=1"
)
)>"%temp%\filterEOD2.tmp"
:out
start "Filter EOD Files" "%temp%\filterEOD2.tmp"
del "%temp%\filterEOD.tmp"
Code: Select all
@echo off
set "xmlpath=\\Server1\developer\inetpub\Ftproot\XMLs\*.xml"
dir /o:-d /a-d "%xmlpath%" |find "/" >"%temp%\filterEOD.tmp"
set "found=0"
set "files=0"
setlocal enabledelayedexpansion
(
for /f "usebackq tokens=1,2,3,4,*" %%a in ("%temp%\filterEOD.tmp") do (
set "f3=%%e"
echo %%e %%a %%b %%c
if !found! GTR 0 set /a files+=1
IF /i "!f3:~0,3!" EQU "EOD" IF !found! GTR 0 (
set /a files-=1
echo(
echo located !files! files between EOD files in total
echo(
goto :out
)
IF /i "!f3:~0,3!" EQU "EOD" set /a found+=1
)
if !found! LSS 2 (
echo(
echo Only !found! EOD file found
echo !files! files were found from the first EOD file
)
)>"%temp%\filterEOD2.tmp"
:out
start "Filter EOD Files" "%temp%\filterEOD2.tmp"
del "%temp%\filterEOD.tmp"
Code: Select all
EODMESS_20151001_1076445661.xml 10/01/2015 05:56 PM
located -1 files between EOD files in total
MattW76 wrote:Working perfectly now Foxidrive, thanks again!