Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Creating a blank file  (Read 3881 times)

0 Members and 1 Guest are viewing this topic.

Muneesh Dhingra

  • Guest
Creating a blank file
« on: August 11, 2004, 01:10:09 PM »
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.

yeah right

  • Guest
Re: Creating a blank file
« Reply #1 on: August 11, 2004, 02:51:45 PM »
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.

johnwill

  • Guest
Re: Creating a blank file
« Reply #2 on: August 11, 2004, 02:51:46 PM »
Well, it's easy to get close, this creates a file with a space and a C/R-L/F pair. :)

echo. >file.txt

Muneesh Dhingra

  • Guest
Re: Creating a blank file
« Reply #3 on: August 12, 2004, 12:43:48 PM »
Thanks for the help.  Both work great.