Re: Parsing file using FOR command not working correctly
From: foxidrive (foxidrive_at_Shotmail.com.invalid)
Date: 07/12/04
- Next message: Darrel: "Moving Iss LOGs"
- Previous message: Jerold Schulman: "Re: Parsing file using FOR command not working correctly"
- In reply to: Dave Pink: "Parsing file using FOR command not working correctly"
- Next in thread: guard: "Re: Parsing file using FOR command not working correctly"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 03:32:27 +1000
On 12 Jul 2004 09:08:01 -0700, Dave Pink wrote:
> I'm using PsLogList from www.sysinternals.com to dump the contents of
> an Event Log. The output is saved to the file hotfix.txt.
>
> Contents of hotfix.txt:
>
> [3166] NtServicePack
> Type: INFORMATION
> Computer: PRDW2K-WEB109
> Time: 6/27/2004 2:02:37 AM ID: 4377
> Windows 2000 Hotfix KB837001 was installed.
>
>
> Using the FOR command, I'm trying to extract just the Event Log
> number; in this case it's 3166. I can't get it to work right.
>
>
> How can I set the variable "Number" equal to "3166"? Any help would be
> appreciated. Thanks.
@echo off
FOR /F "tokens=1 delims=[] " %%a in (hotfix.txt) DO SET Num=%%a&goto skip
:skip
ECHO %Num%
- Next message: Darrel: "Moving Iss LOGs"
- Previous message: Jerold Schulman: "Re: Parsing file using FOR command not working correctly"
- In reply to: Dave Pink: "Parsing file using FOR command not working correctly"
- Next in thread: guard: "Re: Parsing file using FOR command not working correctly"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|