Solved

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

Posted on 2010-11-19
5
699 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now