S
Scott
Hi,
I hope this is an appropriate newsgroup for this msg. I did search the
newsgroups and this one seemed the most appropriate.
I have a logging directory with a bunch of files named like this:
foo.log.23Feb2004_15_38_32
foo.log.25Dec2004_15_38_32
foo.log.14Jan2004_15_38_32
foo.log.07Jun2004_15_38_32
foo.log.17Mar2004_15_38_32
So, the files do not sort in chronological order. Yes, the naming
convention is brain-dead, but is non-configurable.
I have a batch file like so, where I am invoking an editor on all the
desired log files of interest, in order to debug problems:
@echo off
FOR %%a IN (D:\Logs\TheApplication\authentication\*) DO set auth=%%a
FOR %%z IN (D:\Logs\TheApplication\authorization\*) DO set az=%%z
set FILE1=D:\Logs\TheApplication\foo\bar.log
set FILE2=D:\Logs\TheApplication\bar\foo.log
....
set FILE10=%auth%
set FILE11=%az%
"C:\Program Files\TextPad 4\TextPad.exe" "%FILE1%" "%FILE2%" ... "%FILE10%"
"%FILE11%"
In the FOR loop above, is there a way to get the files returned in last
modification date order, instead of filename sorted order, so that the
variables auth and az will be set to the proper files? I'd prefer to use
CMD rather than PERL since PERL won't be on all the machines that may use
this CMD file. If you do suggest alternatives, hopefully it will be using
tools available in a standard install of W2K.
Thanks,
Scott
I hope this is an appropriate newsgroup for this msg. I did search the
newsgroups and this one seemed the most appropriate.
I have a logging directory with a bunch of files named like this:
foo.log.23Feb2004_15_38_32
foo.log.25Dec2004_15_38_32
foo.log.14Jan2004_15_38_32
foo.log.07Jun2004_15_38_32
foo.log.17Mar2004_15_38_32
So, the files do not sort in chronological order. Yes, the naming
convention is brain-dead, but is non-configurable.
I have a batch file like so, where I am invoking an editor on all the
desired log files of interest, in order to debug problems:
@echo off
FOR %%a IN (D:\Logs\TheApplication\authentication\*) DO set auth=%%a
FOR %%z IN (D:\Logs\TheApplication\authorization\*) DO set az=%%z
set FILE1=D:\Logs\TheApplication\foo\bar.log
set FILE2=D:\Logs\TheApplication\bar\foo.log
....
set FILE10=%auth%
set FILE11=%az%
"C:\Program Files\TextPad 4\TextPad.exe" "%FILE1%" "%FILE2%" ... "%FILE10%"
"%FILE11%"
In the FOR loop above, is there a way to get the files returned in last
modification date order, instead of filename sorted order, so that the
variables auth and az will be set to the proper files? I'd prefer to use
CMD rather than PERL since PERL won't be on all the machines that may use
this CMD file. If you do suggest alternatives, hopefully it will be using
tools available in a standard install of W2K.
Thanks,
Scott