Solved keeping leading spaces in txt file

February 21, 2013 at 08:49:23
Specs: Windows 7

I have a file that has many lines with centered text and i want to echo every line of that text file without losing leading spaces in every line...

See More: keeping leading spaces in txt file

Report •


#1
February 21, 2013 at 09:06:48


Report •

#2
February 21, 2013 at 09:17:15

but i need to use those lines with the leading spaces in strings or variables

Report •

#3
February 21, 2013 at 09:59:10
✔ Best Answer

Make your delim ff hex

:: ===== script starts here ===============
::
:: keepspac.bat 2013-02-22 0:07:45.23
@echo off > newfile & setLocal enableDELAYedeXpansioN

for /f "tokens=* delims=๛" %%a in (myfile) do (
echo %%a
)>> newfile
::====== script ends here =================

=====================
M2 Golden-Triangle


Report •

Related Solutions

#4
February 21, 2013 at 10:10:45

thanks alot.that's what i really wanted

Report •

#5
February 21, 2013 at 10:26:02

Then that's what you should have really asked? You can also do away with the delim all together.
for /f "delims=" %%a in (somefile.txt) do echo %%a

How To Ask Questions The Smart Way


Report •

#6
February 21, 2013 at 10:58:34

R2 strikes again.

[duh]

I have a hard time keeping it simple.

=====================
M2 Golden-Triangle


Report •


Ask Question