Solved

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

Posted on 2010-11-19
5
725 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 300 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 100 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 100 total points
ID: 34177002
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 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