Computing.Net > Forums > Disk Operating System > Redirecting text file to a 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.

Redirecting text file to a variable?

Reply to Message Icon

Name: Darkshadeau
Date: July 27, 2000 at 06:17:34 Pacific
Comment:

How do you redirect the contents of a text file to a variable in a batch file? Is it possible?

-Darkshadeau



Sponsored Link
Ads by Google

Response Number 1
Name: DoOMsdAY
Date: July 27, 2000 at 06:59:55 Pacific
Reply:

Have you tried looking at this DOS Batch Programming site that W0rm posted a while back?


0

Response Number 2
Name: Darkshadeau
Date: July 27, 2000 at 07:08:12 Pacific
Reply:

Thanks DoOMsdAY, I had lost that link.

-Darkshadeau


0

Response Number 3
Name: DoOMsdAY
Date: July 27, 2000 at 07:21:39 Pacific
Reply:

Hope it helps! It's a really great site (as you probably already know.) :)


0

Response Number 4
Name: Darkshadeau
Date: July 27, 2000 at 10:40:11 Pacific
Reply:

FYI: The answer to my question is:

:: result.bat
@ECHO off
ECHO. >> result1.dat
DATE < result1.dat | find "):" > result1.bat
ECHO set var=%%4> enter.bat
FOR %%C IN (CALL DEL) DO %%C result1.bat
DEL enter.bat
:: %optional% DEL result1.dat

This information was found at:
Batfiles - The DOS batch file programming handbook

P.S. I found this link through the above mentioned DOS Batch Programming link provided by DoOMsdAY. Thanks again.


0

Response Number 5
Name: DoOMsdAY
Date: July 27, 2000 at 12:09:43 Pacific
Reply:

Well that was pretty straight-forward. ;) Thanks for posting the solution, Darkshadeau! :)


0

Related Posts

See More



Response Number 6
Name: W0rm
Date: July 27, 2000 at 13:37:01 Pacific
Reply:

too bad you cant store a file thats big at all in a variable eh? 40000bytes would be entirely impossible, and even 128 bytes would be pushing it.
- W0rm


0

Response Number 7
Name: JR
Date: July 27, 2000 at 15:57:26 Pacific
Reply:

I think I'll combine my printer and my scanner and invent "paper-memory", like punch cards, but optical! Then I could use that as virtual memory and get more free memory to vari... no! s---. I forgot something.


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: Redirecting text file to a variable?

Set number of lines from a file to a var www.computing.net/answers/dos/set-number-of-lines-from-a-file-to-a-var/6487.html

copy a file to a variable www.computing.net/answers/dos/copy-a-file-to-a-variable/12678.html

read multiple variable from file to batc www.computing.net/answers/dos/read-multiple-variable-from-file-to-batc/7436.html