1.

Solve : Creating a blank file?

Answer»

I am looking for a way to create a blank file in dos using a batch file.

What I mean is there is an existing file called FileA.dbf and I want to delete the existing file and replace it with a new file called FileA.dbf, but with nothing in it.  I thought of using edit FileA.dbf, but is there a SWITCH to close the edit WINDOW?

Thanks for any insight you might have on this.
here is a solution that you might find helpful, i'll assume that you're working with text files but in my experience, it WORKS with other file formats a well


create a blank txt file called "test.txt"

create a batch file with this line in it
"type test.txt > FileA.txt"

every TIME this batch file is run, it overwrites FileA with the contents of test.txt which happens to be blank.Well, it's easy to get close, this CREATES a file with a space and a C/R-L/F pair.

echo. >file.txt
Thanks for the help.  Both work great.



Discussion

No Comment Found