Batch parse
|
Original Message
|
Name: momchil
Date: October 8, 2007 at 03:31:09 Pacific
Subject: Batch parseOS: windows XP SP2CPU/Ram: 1000/500 |
Comment: Hi, I need to parse a text file like this one process.exe; process name process1.exe; process1 name ........... so I need to asign a name for a process I need to search another text file for a process and if exists to tell the application name using this process. the thing I do not get is how to seperate the words with the (;) and put them in different variables %process% and %process_name%. Thank you
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Mechanix2Go
Date: October 8, 2007 at 04:27:56 Pacific
|
Reply: (edit)@echo off setLocal EnableDelayedExpansion for /f "tokens=1-2 delims=;" %%a in (myfile) do ( set process=%%a & set process_name=%%b echo !process! !process_name! )
===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: momchil
Date: October 8, 2007 at 04:51:48 Pacific
|
Reply: (edit)sorry for the spam but .. still .. one more issue,each process should be searched in a third file and if exist echo process name smt like for /f "tokens=1-2 delims=;" %%a in (myfile) do ( type third.file | find ^/%%a ) if errorlevel 1 echo process name ( %%b ) else goto somewhere
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: