Grabbing a piece of text?

  • Thread starter Thread starter LWG
  • Start date Start date
L

LWG

I have an output file that I want to grab a piece of text from. The file
looks as follows:

output below:

name: FZRVEW2761W
dn:
CN=fzrvew2773w,OU=Computers,OU=Riverview,OU=CCN,DC=Na,DC=Corp,DC=Cargill,DC=
com

name: fzrvew2773w
dn:CN=fzrvew2774w,OU=Computers,OU=Riverview,OU=CCN,DC=Na,DC=Corp,DC=Cargill,
DC=com

I want to grab the computername "fzrvew2761w". What would be the best way?

TIA
 
I have an output file that I want to grab a piece of text from. The file
looks as follows:

output below:

name: FZRVEW2761W
dn:
CN=fzrvew2773w,OU=Computers,OU=Riverview,OU=CCN,DC=Na,DC=Corp,DC=Cargill,DC=
com

name: fzrvew2773w
dn:CN=fzrvew2774w,OU=Computers,OU=Riverview,OU=CCN,DC=Na,DC=Corp,DC=Cargill,
DC=com

I want to grab the computername "fzrvew2761w". What would be the best way?

TIA
For /f "Tokens=2 Delims=:" %%i in ('type Thefilename') do set name&%%i&call
:dosomething


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
JS, I thought the delim referred to end of line. Or, does this refer to
basically I want whats after the colon? This has been a point of confusion
for me...

Thx AGAIN for your help...
 
Back
Top