Page 1 of 1

Command output parser

Posted: 18 Aug 2010 06:10
by karzer
Hi,
The command output below the Name line just want to take the next spot

User: Win32_Account.Domain="ader",Name="hasan"
User: Win32_Account.Domain="ader",Name="osman"
User: Win32_Account.Domain="ader",Name="hüseyin"
User: Win32_Account.Domain="ader",Name="ali"

I want to be like that, I wonder how can I do?

Name="hasan"
Name="osman"
Name="hüseyin"
Name="ali"

Thank you

Re: Command output parser

Posted: 18 Aug 2010 07:23
by karzer

Code: Select all

FOR /F "tokens=3 delims=." %%G IN example.txt DO @echo %%G

Re: Command output parser

Posted: 18 Aug 2010 08:20
by aGerman
Is the last post your solution?

Otherwise I would suggest to use that:

Code: Select all

FOR /F "tokens=2 delims=," %%G IN example.txt DO @echo %%G


Regards
aGerman

Re: Command output parser

Posted: 18 Aug 2010 08:38
by ghostmachine4
download gawk for windows , then use this

Code: Select all

c:\test>  gawk.exe -F"," "{print $NF}" file
Name="hasan"
Name="osman"
Name="hüseyin"
Name="ali"