Tech Support > Operating Systems > MS-DOS > Avoiding extra line in Command Line Output
Avoiding extra line in Command Line Output
Posted by Nathan Sokalski on January 14th, 2005


I have several batch files (*.bat) that redirect their output to files.
However, they all add a blank line at the end which I do not want. What can
I do to get rid of this extra line? Any help would be appreciated. Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
www.nathansokalski.com


Posted by Ted Davis on January 14th, 2005


On Fri, 14 Jan 2005 01:21:52 GMT, "Nathan Sokalski"
<njsokalski@verizon.net> wrote:

The more mutually exclusive groups you cross post to, the less your
chance of getting a reasonable answer, especially when it's a FAQ.

Your program probably ends with a blank line - remove the last newline
marker. Either that or the last command outputs a trailing blank.


--
T.E.D. (tdavis@gearbox.maem.umr.edu)

Posted by Nathan Sokalski on January 14th, 2005


I was probably a little bit unclear when I said what I was doing. I'm not
really using any batch files, just a series of commands separated by && .
The commands that I am using are sort, copy, and del, so I'm assuming the
one that adds the extra line is sort since the original input file does not
have any blank lines.
--
Nathan Sokalski
njsokalski@hotmail.com
www.nathansokalski.com

"Ted Davis" <tdavis@gearbox.maem.umr.edu> wrote in message
news:g3aeu05joqf2qn34tverigq5cjs4bdm8li@4ax.com...


Posted by Timo Salmi on January 14th, 2005


Nathan Sokalski <njsokalski@verizon.net> wrote:
Depending on your OS see either

107700 Dec 3 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

or

250909 Oct 12 2004 ftp://garbo.uwasa.fi/pc/link/tsbat.zip
tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi

Then reselect your newsgroups in accordance with your OS.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:ts@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html

Posted by Ted Davis on January 14th, 2005


On Fri, 14 Jan 2005 04:37:24 GMT, "Nathan Sokalski"
<njsokalski@verizon.net> wrote:

Curious, you asked a *totally* misleading XP console question is four
inappropriate newsgroups. That is just *wrong*.

SORT does add a blank line - many, if not most, commands do. Anything
that terminates all its lines with \n, and that's just about
everything, does. To avoid it, you have to handle printing the last
line in a different way and few programmers go to the usually
unnecessary trouble to do that - in fact, some apps consider a line
that doesn't end with \n to be an error.

--
T.E.D. (tdavis@gearbox.maem.umr.edu)


Similar Posts