> -----Original Message-----
> From: Justin Fancy [private.php?do=newpm&u=]
> Posted At: Monday, October 23, 2006 4:05 PM
> Posted To: microsoft.public.win2000.cmdprompt.admin
> Conversation: Comparing text files
> Subject: Comparing text files
>
>
> Hi,
>
> I have two text files and I need to compare them both, and output the
> differences to another text file.
>
> I am comparing a server directory and an IIS Log to see which server
> files are of no use to the company anymore (outdated, etc.).
>
> Any suggestions?
>
> Justin
>
Justin,
It would help if you can provide an example of your IIS logs format.
If speed is not your concern, you could probably go with something as
easy as piping dir output to find/findstr command that will take it as
an argument and will search for string occurences in you IIS logs.
Something like following (untested):
@echo off
setlocal
set iislogsdir="c:\my_iis_logs"
if exist %iislogsdir% (
for /f "delims=" %%i in (www-directory-tree.txt) do (
findstr /b /l "%%i" %iislogsdir%>nul 2>&1 || echo "%%i" is not
fould in logs.
)
)
However, depending of your www dirctory and logs sizes it could take a
long time to complete. Another caveat would be the possible presence of
certain "poison" characters in logs that findstr or batch commands could
not interpret correctly as strings and would threat them as additional.
You could also parce IIS logs first to produce a more compact summary
and then do the same against it. There's a free Microsoft tool that is
good at parsing different kind of logs including IIS called LogParser:
http://www.microsoft.com/technet/scr...ser/default.ms
px
--
Alexander Suhovey