Search : in
By :

Batch file to read files

Last answer on Feb 13, 2009 5:43:44 am GMT trusp, on Dec 10, 2008 11:39:54 am GMT 
 Report this message to moderators

Hello,

I want to read a file and print the contents.
But the path of the file will be having space with it.

For loop not supporting those files when we
specify the path with space.

Please see this example for getting my req:

@ echo off
set TEXT_T="C:\R Test\text1.txt"
for /f "eol= tokens=* delims= " %%i in
(%TEXT_T%) do (
echo %%i
)

This is not displaying the file contents.
Instead displays the whole path.

All bcoz: R Test

So, Please help me out in this...

Thanks
Trusp

Configuration: Windows 2000
Internet Explorer 6.0

Best answers for « Batch file to read files » in :
Batch file – Get Filenames & Timestamps Show Batch file – Get Filenames & Timestamps Issue Solution Note Issue Can anyone help me create a batch file that will display all the files, subfolders and files under subfolders of folder with both date created and date modified then...
Batch file Show Batch file Settings File Creation DOS is integrated in windows which allow to exploit functionality and command sequence in a script. A batch file is a text file which contains command to be read by DOS. This file can be launched...
Writing in batch in text file ShowWriting in batch in text file To write in a file text, you just have to use a redirect: echo text > output_file.txt To write in an existing file: echo " Write at the end of the file ">> output_file.txt
[PYTHON]Read and Write CSV files Show[PYTHON] Read and Write CSV files Prerequisite Writing a CSV file Reading a CSV file Python Www.python.org, version 2.4 supports the de facto CSV format (comma-separated values: Comma Separated Values). The Reference Library...
What is a batch file? ShowWhat is a batch file? Creating a batch file Prerequisites Create file Windows comes with a version of DOS, which allows you,exploiting the features and the sequence of commands in a script. Batch file, is a simple text file (ascii)...

1

 Zeta, on Feb 13, 2009 5:43:44 am GMT

Try this:

@ echo off
set TEXT_T="C:\R Test\text1.txt"
for /f "eol= tokens=* delims= usebackq" %%i in
(%TEXT_T%) do (
echo %%i
)

Reply to Zeta