Yes, sorry. It's a windows environment.
That looks like it will work very well, except for whitespace. Thank you!
As a follow-up, how would it be done to remove four specific strings at the beginning of three of the four files and get the outfile to be sorted by a timestamp within each file?
ex:
Remove these lines from all but the first file:
#Software: Microsoft Internet Information Services 5.0
#Version: 1.0
#Date: 2003-04-25 14:47:06
#Fields: date time c-ip cs-username s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status cs(User-Agent)
And sort by the time stamp in the second column of data.
2003-04-25 14:47:06 192.168.168.10 - 192.168.168.20 80 GET /Content/css/mainStyles.cs
Main Topics
Browse All Topics





by: _nn_Posted on 2003-11-19 at 11:47:52ID: 9781790
Assuming Windows (you didn't mention...) and a structure like
][0-9][0-9 ].log
\test
\a
\b
\c
\d
\e
\global
I would propose something like following (tested on W2K) :
@echo off
set BASE=\test\
set DIRS=a b c d\e
set TARGET=\test\global
set MASK=ex[0-9][0-9][0-9][0-9
set LAST=
pushd %BASE%
for /f "delims=" %%k in ('dir /b %DIRS% ^| findstr /R "%MASK%" ^| sort') do call :do_it %%k
popd
goto end
:do_it
if "%1" == "%LAST%" goto end
set LAST=%1
for %%a in (%DIRS%) do if exist %%a\%1 (>>%TARGET%\%1 type %%a\%1)
:end