?
Solved

How to write/append a blank line to a text file from a DOS batch command file

Posted on 2010-11-19
5
Medium Priority
?
732 Views
Last Modified: 2012-05-10
Hello,

SET "space= "
echo testing > temp.txt
echo %space% >> temp.txt
echo 123 >> temp.txt

Problem is temp.txt contains

testing
ECHO is on.
123

and I'd like it to contain

testing

123
0
Comment
Question by:pdegregorio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 10

Accepted Solution

by:
lucius_the earned 1200 total points
ID: 34176989
Too add a blank line use:
"echo."
0
 
LVL 10

Expert Comment

by:lucius_the
ID: 34176993
LIke this

SET "space= "
echo testing > temp.txt
echo . >> temp.txt
echo %space% >> temp.txt
echo . >> temp.txt
echo 123 >> temp.txt
0
 
LVL 8

Assisted Solution

by:Den_HBR
Den_HBR earned 400 total points
ID: 34176994
echo testing > temp.txt
echo. >> temp.txt
echo 123 >> temp.txt

0
 
LVL 10

Expert Comment

by:lucius_the
ID: 34176999
Aah. Without spaces, sorry, again:
SET "space= "
echo testing > temp.txt
echo. >> temp.txt
echo %space% >> temp.txt
echo. >> temp.txt
echo 123 >> temp.txt
0
 
LVL 4

Assisted Solution

by:Andre412
Andre412 earned 400 total points
ID: 34177002
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question