Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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