D
djc
I have a batch file that appends to a log file. The file has multiple fields
and uses a ',' as a delimiter. The first 2 fields are %date% and %time%. My
windows 2000 and XP machines fill in these fields fine however my NT4
machines do not. So for all lines from an NT4 machine the first two fields
are blank like so:
, , computername, operating system, other stuff etc..
I use the 'find' and 'for' commands on this log file a lot. However the
results when using FOR get messed up due to the NT4 machines leaving blanks.
Say I want to display only computername field. The token would be 3, which
works fine except for the NT4 lines which return the operating system in
example above.
questions:
1) is there a date and time variable that will work for both NT4 and
2000/XP?
2) Is there a way to tell the FOR command to somehow count the first , as 1
so my tokens don't get off? Or do I need to add a space before the first
comma on every log entry? that seems sloppy.
Any input is appreciated. Thanks.
and uses a ',' as a delimiter. The first 2 fields are %date% and %time%. My
windows 2000 and XP machines fill in these fields fine however my NT4
machines do not. So for all lines from an NT4 machine the first two fields
are blank like so:
, , computername, operating system, other stuff etc..
I use the 'find' and 'for' commands on this log file a lot. However the
results when using FOR get messed up due to the NT4 machines leaving blanks.
Say I want to display only computername field. The token would be 3, which
works fine except for the NT4 lines which return the operating system in
example above.
questions:
1) is there a date and time variable that will work for both NT4 and
2000/XP?
2) Is there a way to tell the FOR command to somehow count the first , as 1
so my tokens don't get off? Or do I need to add a space before the first
comma on every log entry? that seems sloppy.
Any input is appreciated. Thanks.