Jump to content
xisto Community
Sign in to follow this  
coolcat50

How To Use Command Prompt As A Text Editor

Recommended Posts

In this tutorial, I will show you how you can use Command Prompt to create text files. It is very simple and you can also use it to write output from a command into a text file. This can be particularly useful when you need documentation from a DOS program in a text file when you use the help command or something similar. In order to do this you simply use this DOS command.

CONSOLE
echo Text >> test.txt
This will create a new text file called test and echo the contents into it. If we wanted to write a 2 line document, we could do something like:
CONSOLE
echo Hello >> test.txtecho Person >> test.txt
The Command Prompt automatically does linebreaks each time the command is used.I also stated that you can put documentation into a text file this way.I will use the Perl documentation command as an example.
CONSOLE
perldoc perl >> perldoc.txt
That will put the output from perldoc into the file perldoc.txt.Thanks for reading this material and have fun doing text writing the old school way.

Share this post


Link to post
Share on other sites

Well that is one way to do it, but an easier way to edit text is available. Pretend we have a file in our desktop called "test.Txt" without the quotations. To edit this file, you can type the following command:Copy con test.TxtTo use this, you should be in the same directory as the file, so, in a Windows computer your command would actually look like this:C:Documents and SettingsUserDesktop> copy con test.TxtBE WARNED: This overwrites ALL OF YOUR TEXT! It is very useful to create a new document, but for editing an existing document it would be easier to just type this:Notepad test.TxtSo it opens instead of overwriting-reply by Jesse

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.