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?
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?
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
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
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
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.
Summary: Hi. What I'm trying to do is to append the number of lines from a file to a variable. The file's lines would have only one character (and always the same character: "]"). Just that. ie: ::txt.txt ] ]...
Summary: Hi! I want to copy a file from a server to the desktop. Trouble is i want to do it for lots of ppl so i set a variable using USERNAME so it looks something like: Can't do backslashes so the'll be repr...
Summary: I am attempting to read multiple variables from a text file to a batch file. I need the batch to read two variables per line 1, then run code, then loop and read next two variables on line 2, line 3, ...