Extract string from CSV file.
Posted: 17 Mar 2009 11:20
I'm using tasklist command in a batch file to list details of a particular exe.
For e.g
C:\SysinternalsSuite>tasklist /fo CSV /fi "imagename eq radmin.exe"
which returns with
"Image Name","PID","Session Name","Session#","Mem Usage"
"Radmin.exe","3224","Console","0","3,600 K"
I need to extract the Session # which is 0 so I can use it my next step in the batch. Is there a way to extract the Session # value from this CSV for so I can set it to an Env variable and use it later on in my script.
Thanks in advance..
For e.g
C:\SysinternalsSuite>tasklist /fo CSV /fi "imagename eq radmin.exe"
which returns with
"Image Name","PID","Session Name","Session#","Mem Usage"
"Radmin.exe","3224","Console","0","3,600 K"
I need to extract the Session # which is 0 so I can use it my next step in the batch. Is there a way to extract the Session # value from this CSV for so I can set it to an Env variable and use it later on in my script.
Thanks in advance..