Jump to content

CMD: Delete Empty Line


Recommended Posts

Hi guys! If i have this script:

@ECHO OFF

ECHO=HELLO>>file.txt

As result i have a file called file.txt that contains ath the first line the word "HELLO", while the second line is empty. Is it possible to have a file without the second line, but only the first line containing the word "HELLO" ?? (in this case)

Thank you for your help!

Link to comment
Share on other sites


A carriage return and line feed is the standard method for terminating a Windows text file, in fact some files not ending that way can be seen as corrupt. A solution to change a file after it has already been written may or may not be the more suitable option depending upon your 'real world' need. What data are you really outputting and what construct is being used to output it?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...