[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
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
?
745 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 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
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…
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

830 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