• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 750
  • Last Modified:

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

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
pdegregorio
Asked:
pdegregorio
  • 3
3 Solutions
 
lucius_theCommented:
Too add a blank line use:
"echo."
0
 
lucius_theCommented:
LIke this

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

0
 
lucius_theCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now