Using TYPE to create and edit text files

1 January 2000 by Snakefoot | Comment » | Trackback Off
TYPE is a command that can output the contents of a text file. The output of TYPE can then be used to modify other files, which can be used in batch files.

To display the contents of a text file (Old.bat) with TYPE:

TYPE Old.bat | MORE

To create a copy of a file (Old.bat) to or overwrite an existing (New.bat):

TYPE Old.bat > New.bat

To append the contents of one file (Old.bat) to another file (New.bat):

TYPE Old.bat >> New.bat

To create an empty file:

TYPE nul > New.bat

Remember though that it will only work with text-files, not with binary files.

Related Using ECHO to modify text files.
Category:

Updated: 2 July 2007

Leave a comment


NB! Use the Forum for computer help and off-topic questions.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>