Computing.Net > Forums > Programming > batch file to clear txt file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

batch file to clear txt file

Reply to Message Icon

Name: montag451
Date: June 23, 2005 at 09:13:40 Pacific
OS: Win XP Pro
CPU/Ram: 1.3 / 256
Comment:

How can I use a batch file to clear the contents of .txt file without deleting it?



Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: June 23, 2005 at 09:49:58 Pacific
Reply:

Hi

echo. > File.txt


0

Response Number 2
Name: montag451
Date: June 23, 2005 at 09:59:08 Pacific
Reply:

but that places either "echo is on" or "echo is off" into the text file. I don't want any text in that file.


0

Response Number 3
Name: dtech10
Date: June 23, 2005 at 15:43:46 Pacific
Reply:

Hi
did you enter the period after echo.
ECHO. > FILE.TXT


0

Response Number 4
Name: montag451
Date: June 23, 2005 at 15:57:22 Pacific
Reply:

No - thanks that works.


0

Response Number 5
Name: dtech10
Date: June 23, 2005 at 16:56:41 Pacific
Reply:

Hi
Sorry that creates a blank line.
Try type nul > file.txt


0

Related Posts

See More



Response Number 6
Name: Mechanix2Go
Date: June 23, 2005 at 23:49:41 Pacific
Reply:

or,

@echo on>file

M2


If at first you don't succeed, you're about average.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Search for substring and ... turn off batch file delet...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file to clear txt file

Batch File to remove files www.computing.net/answers/programming/batch-file-to-remove-files-/16226.html

batch file to change prices in ini www.computing.net/answers/programming/batch-file-to-change-prices-in-ini/17482.html

batch file coverting to VBS file www.computing.net/answers/programming/batch-file-coverting-to-vbs-file/15717.html