Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Reading text from to variable
Name: Zangor Date: March 10, 2005 at 04:51:54 Pacific OS: Xp CPU/Ram: 2800 512mb ram
Comment:
I want to read a textfile and put the content to variable.
Name: Mechanix2Go Date: March 10, 2005 at 05:03:37 Pacific
Reply:
in DOS or XP?
M2
0
Response Number 2
Name: Zangor Date: March 10, 2005 at 05:48:05 Pacific
Reply:
In a bat-file in Dos
/This was the word of Zangor
0
Response Number 3
Name: Mechanix2Go Date: March 10, 2005 at 06:36:40 Pacific
Reply:
Is the text file just one line?
What size is the file?
M2
0
Response Number 4
Name: Zangor Date: March 10, 2005 at 08:54:15 Pacific
Reply:
the text file is more than one line and i want to get i all out to diferent variables
/This was the word of Zangor
0
Response Number 5
Name: jboy Date: March 10, 2005 at 09:04:26 Pacific
Reply:
"in DOS or XP?" means: Are you running DOS, the Operating System, or are you employing the Command Prompt from within WinXP?
Give me ambiguity or give me something else
0
Response Number 6
Name: Zangor Date: March 10, 2005 at 09:06:03 Pacific
Reply:
I'm running Xp Command Prompt
/This was the word of Zangor
0
Response Number 7
Name: jboy Date: March 10, 2005 at 09:19:28 Pacific
Reply:
I imagine you must have breezed right past this message at the top of the forum:
This forum is for all Standalone versions of DOS, not the "DOS" prompt contained inside later versions of Windows.
As well, there is a somewhat different command set contained in the XP emulation, so what works in true DOS may not work under XP's 'extended DOS', or there may be better options unique to that environment
Give me ambiguity or give me something else
0
Response Number 8
Name: dtech10 Date: March 12, 2005 at 08:51:07 Pacific
Reply:
Hi Is it ok to help Zanger here even if is is the wrong forum or is this frowned upon. Thanks DTech10
0
Response Number 9
Name: Mechanix2Go Date: March 12, 2005 at 08:54:44 Pacific
Reply:
Hi dtech10,
Doesn't bother me.
I'd always rather help than bitch somebody out.
A couple guys who repond here are on the verge of a mental breakdown.
M2
0
Response Number 10
Name: jboy Date: March 12, 2005 at 11:16:31 Pacific
Reply:
If you can help, that's fine. It is in the poster's best interest to specify just what version of DOS (or "DOS") pertains to the actual question, as the answers may well be different. As you can tell from this post, even asking point blank wasn't enough.
It's also in the poster's best interest to choose the appropriate forum. If someone posted a Linux or Mac question here, what would be the response? Would someone try and answer it, or would reposting in a more relevant forum be suggested?
I just find it completely weird that folks running Windows post in the DOS forum - - seems like a kind of mental disconnect
Give me ambiguity or give me something else
0
Response Number 11
Name: Mechanix2Go Date: March 12, 2005 at 11:37:33 Pacific
Reply:
Hi Zanger,
This should work with lines containing up to 9 'words'.
::== set varNUM=0
for /f "tokens=*" %%T in (some.txt) do call :varSET %%T
goto :eof
:VarSET
set /a varNUM=%varNUM%+1
set MYvar%varNUM%=%1 %2 %3 %4 %5 %6 %7 %8 %9 ::==
HTH
M2
0
Response Number 12
Name: Mechanix2Go Date: March 28, 2005 at 07:57:27 Pacific
Reply:
Once again, as in the Zen tradition, a thunderous silence.
M2
If at first you don't succeed, you're about average.
Summary: I'd like to know how to read in from a file, txt or otherwise, to a variable. I'm trying to read a list of computers from a text file one at a time into a variable so that commands could be preformed...
Summary: Hi All, I wish to be able to rename a file using part of a line in another file as the new name. I have a file named Variable.var which is basically a text file, in that file is a line reading WEEKNO=...
Summary: bunder is right! - Horst has some great stuff, all FREEWARE. In case you're wondering before you hit the old Right-click > Open in New Window, Here's what you'll find there: WBAT Dialog boxes with me...