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.
trailing white space
Name: MaRtO Date: May 17, 2009 at 06:52:31 Pacific OS: Windows Vista Subcategory: Batch
Comment:
Hi,
With this loop I can replace a text string in a text file. But the output has some trailing white space and I can't find the cause of it.
SetLocal EnableDelayedExpansion
for /f "tokens=* delims=" %%G in ('type "%cd%\test.txt"') do (
set lines=%%G
set lines=!lines:changethis=%cd%!
echo !lines!>> "%cd%\test2.txt" )
Name: MaRtO Date: May 17, 2009 at 09:43:48 Pacific
Reply:
I found the solution:
SetLocal EnableDelayedExpansion
for /f "tokens=* delims=" %%G in ('type "%cd%\test.txt"') do (
set lines=%%G
set lines=!lines:changethis=%cd%!
echo !lines!>> "%cd%\test2.txt"
)
Summary: Hello, Thanks for your reply. I have a brother named Fred. Maybe if I include a sample data file it will help to demonstrate removal of extra blank lines. Not all cr/lf are removed. Each line is termi...
Summary: I have a web page with nothing on it but a graphic. Is there any way of loading and/or creating the page so white space does not appear around the image? I am loading the graphic into the web browser ...
Summary: I want to scan few lines in “C” from a standard input by a user and then parse each word after I encounter a new line if I see a white space I need to skip it, and parse the whole line. For example if...