Computing.Net > Forums > Disk Operating System > Reading text from to variable

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

Reply to Message Icon

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.

/This was the word of Zangor



Sponsored Link
Ads by Google

Response Number 1
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

Related Posts

See More



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.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Reading text from to variable

Read in from text file www.computing.net/answers/dos/read-in-from-text-file/10895.html

Reading text from a file www.computing.net/answers/dos/reading-text-from-a-file/9080.html

Dos Script to search for text www.computing.net/answers/dos/dos-script-to-search-for-text/13818.html