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 body of text from batch
Name: francoom Date: May 12, 2009 at 05:15:53 Pacific OS: Windows XP Subcategory: Batch
Comment:
I have a file named "test.txt" and I would like to get the content of test.txt in a batch file.
The content of test.txt is: abcdefg hijklmnop qrstuvwxyz
I have this on the batch file:
pffile=test.txt cls binary.exe %pffile%
Where binary.exe is an executable file. My problem is that it interprets it as binary.exe test.txt
What I want is to interpret it as: binary.exe "abcdefghijhklmnopqrstuvwxyz"
Name: Valerie (by Garibaldi) Date: May 12, 2009 at 16:25:46 Pacific
Reply:
One way - untested:
:: Code begins...
@echo off
cls
setlocal enabledelayedexpansion
for /f "delims=" %%1 in (test.txt) do (
set pffile=!pffile!%%1
)
set pffile="%pffile%"
binary.exe %pffile%
:: Code ends...
0
Response Number 2
Name: francoom Date: May 12, 2009 at 20:21:53 Pacific
Reply:
IT WORKED!!!
Thank you so much Gari!!! Your post is greatly appreciated!!!
Thanks! :)
0
Response Number 3
Name: Valerie (by Garibaldi) Date: May 13, 2009 at 00:47:48 Pacific
Summary: Hi. I have a text file "listfile.ini" with up to 50 entries all with the syntax: [code] ; Begin ABC series [ABC1] PATH="..\..\..\ABC1\" CMD="SetKey 11111-22222-33333-44444-55555" [ABC2] PATH="..\..\....
Summary: Does anyone know how to delete the first line of text from a text file using a batch file (or a simple way from the command line)? Thanks, Cory ...
Summary: What I am trying to do is delete the first X number of lines from a text file using a batch file on all text files in a folder. all files are in the format From: <Address> To: <Addresses on in...