Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
A good option would be to use the FOR cmd with the /F switch. But how to use it depends on how should the text be handled.
Let's say you want to send each line from filename.ext to a variable, one line by one:
for /F "tokens=*" %%A in (filename.ext) do (
echo Line processed:
echo %%A
)You might want to send the first line from the file entirely to a certain variable (enviromental variable, like %var%, not like %%A), and just the first line:
for /F "tokens=*" %%A in (filename.ext) do (
set LINE=%%A
goto forend
)
:forend
echo LINE=%LINE%You didn't say how the text should be handled, so I can't post a specific solution.
Tell us how is that file (give an example of the file and of what should be passed to the variable) and we can tell you a solution. You could also try to learn the sintax. By typing "FOR/?" on the command prompt, you'll get a very good information about the command (good enough to learn it).
BTW, there's no "Win2K DOS". There's a command interpreter, CMD.EXE, which looks like DOS's command interpreter, COMMAND.COM. Nevertheless, that's not DOS, not at all.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
proxy
|
Lte 286
|

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