How to echo newline character to an output file

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Contact:

How to echo newline character to an output file

Post by MigrationUser »

12 Sep 2008 11:55
carla

Hello All,

I am trying to echo a newline to an output file, and nothing seems to be working.

something like the following:

echo text1 text1 text1 >> outputfile.out

echo NEWLINE >> outputfile.out

echo text2 text2 text2 >> outputfile.out

I have tried several:

(NEWLINE) , '.', ' ' etc, but nothing works.

----------------------------

#2 12 Sep 2008 12:14
carla

8-)
I solved my own problem, here goes --> echo. will print a new line to an output file.

echo. >> outputfile.out

----------------------------

#3 12 Sep 2008 12:52
bluesxman


Actually that'll put a space and a new line./smartarse

If you want to keep the space out of the equation (sometimes it will matter), you can do this:

Code: Select all

(echo.) > output.txt
cmd | *sh | ruby | chef

----------------------------

#4 19 Sep 2008 16:32
avery_larry
bluesxman wrote:

Actually that'll put a space and a new line./smartarse

If you want to keep the space out of the equation (sometimes it will matter), you can do this:

Code: Select all

    (echo.) > output.txt
Or you can just get rid of the space after the dot -- right?

echo.>>output.txt
Post Reply