Computing.Net > Forums > Programming > set var from a text file in dos

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

set var from a text file in dos

Reply to Message Icon

Name: shadoze
Date: September 28, 2009 at 04:05:06 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

text file contains

SPINSER_CAT5 <00> UNIQUE Registered
IS~SPINSER_CAT5<00> UNIQUE Registered

(first 4 chars are spaces on each line)

How would I go about extracting the first word ( in this example SPINSER_CAT5 )
And setting it as a variable in a dos batch file ?

thanks for looking at this



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 28, 2009 at 04:17:32 Pacific
Reply:

It's either DOS or XP. Not a little of each.


2

Response Number 2
Name: IVO
Date: September 28, 2009 at 05:26:48 Pacific
Reply:

Probably you are running under Windows XP and what you need is a NT batch file as there is no plain DOS in NT based systems.

The script is you want is quite easy but explain better the structure of the text file, i.e does it hold just two lines or how to catch the one holding the word to be extrcted?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


loop structure Open IE8 without menubar ...


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: set var from a text file in dos

Set String from text file www.computing.net/answers/programming/set-string-from-text-file/17629.html

Reading from a text file in C++ www.computing.net/answers/programming/reading-from-a-text-file-in-c/8983.html

Delete blank lines from a text file www.computing.net/answers/programming/delete-blank-lines-from-a-text-file/14525.html