Jul 25, 2008

How To Use Command Prompt As A Text Editor

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials

free web hosting

How To Use Command Prompt As A Text Editor

coolcat50
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.txt
echo 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.

 

 

 


Reply

sunzoje
It's really nice. But what if I have to create multiple line documents. Can I just type and echo it to the txt file?

Reply

coolcat50
Whenever you use the echo command, it automatically creates a linebreak. I think it might not be able to create linebreaks in a single echo statement though.

Reply

anachro
could you explain this better for people who don't get command prompt/learning command prompt?

Reply

suberatu
I don't see myself using something like this anytime in the future, but knowledge is always a good thing. Thanks for the tutorial.

Reply

iGuest
Replying to suberatu

What if I want edit the first line of a text document "//Easting, Northing, Depth" to be "Easting, Northing, Depth" but the file is too large to open in any text editing program (700 mb)

Reply

iGuest
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.Txt

To 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 Settings\User\Desktop> copy con test.Txt

BE 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.Txt

So it opens instead of overwriting

-reply by Jesse

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. cmd prompt edit text - 0.69 hr back. (1)
  2. cmd prompt add text to file - 2.26 hr back. (1)
  3. how to use command prompt in delphi - 3.54 hr back. (1)
  4. delphi command prompt - 4.03 hr back. (1)
  5. how to use cmd to put text in a file - 4.54 hr back. (1)
  6. telnet chat command prompt - 5.30 hr back. (1)
  7. save log entries of command prompt into txt file - 7.02 hr back. (1)
  8. command prompt text editor - 8.01 hr back. (1)
  9. cmd editor - 8.24 hr back. (1)
  10. open text from prompt - 8.55 hr back. (1)
  11. cmd copy con in a script - 10.35 hr back. (1)
  12. make document text in prompt dos - 12.15 hr back. (1)
  13. use command to open internet explorer - 19.04 hr back. (1)
  14. how to edit text into text document using command prompt - 26.71 hr back. (2)
Similar Topics

Keywords : command, prompt, text, editor

  1. To Automatically Run Command When Login / Logoff
    (3)
  2. Create A Simple Html Editor With Php And Javascript
    (3)
    Ok, I will teach you how to create a simple HTML editor that runs online with buttons that add HTML
    tags. Before we start: You should have basic knowledge of these languages. HTML/XHTML
    Javascript PHP You will need Ability to use filesystem functions. Chmodding abilities
    Features of Editor Online PHP safe Full HTML support A Few Bad Features Can only create new
    documents or overwrite Fairly unsafe Now we are ready to begin. The PHP Script This will be
    our PHP script that we will use to make the file. Make a file called save.php Here is the....
  3. How To Make Pixel Text With Paint!
    Cool if you don't have photoshop or any of those (10)
    First you need a font called minimum +1 Follow these instructions CAREFULLY on how to install the
    font. If you're using firefox RIGHT CLICK on the link below and select "save link as"
    DOWNLOAD LINK READ THE ABOVE STUFF BEFORE CLICKING ON ME!!!! Then save it in
    your documents. Don't worry if firefox "quits" the download. As long as it is in your documents
    you're fine. ON IE.... Right click on link above and select "save traget as" Then go to
    start and open up "my documents". The font should be there. Keep that window open g....
  4. Flatfile User Login/signup
    Uses text files only (compatable with forums and message system) (24)
    With this tutorial, you will learn how to create a textfile login script. This user membership
    script is for use also with my forums and message system scripts. I will also give you the scripts
    to make it so that people can change their profiles. Ok, The first thing we need to do is make the
    database. To do this, create a blank text file called 'userdata.txt' , make sure it is ALL
    LOWER-CASE. Edit this file and put
    '**username|##|password|##|email|##|rank|##|userid|##|name|##|picture**'. This will not be
    used, however it will give you an idea of how the....
  5. Chat With Command Prompt
    (26)
    QUOTE Chat With Command Prompt If you want a private chat with a friend or client on you
    Network, you don't need to download any fancy program! All you need is your friends IP
    address and Command Prompt. Firstly, open Notepad and enter: @echo off :A Cls echo MESSENGER set
    /p n=User: set /p m=Message: net send %n% %m% Pause Goto A Now save this as "Messenger.bat". Open
    the .bat file and in Command Prompt you should see: MESSENGER User: After "User" type the IP
    address of the computer you want to contact. After this, you should see this: Message: Now ty....
  6. Sending + Receiving Email Via Telnet
    using email via the command line. (8)
    ok first off im no good at writing tutorials so feel free to flame me (hey that rymes). Anyway in
    this tutorial i will basically show you how to send and receive email via the command-line terminal
    emulation program called Telnet. Now where shall i start, hmm.. Sending Email!! Sending
    Email Sending email requires a special type of server called an SMTP server (SMTP -> Simple Mail
    Transfer Protocol). SMTP is the protocol used to send email just like POP is the protocol used to
    receive. Now by default and most commonly SMTP servers run on port 25. To describe ....
  7. Change / Modify The Title Bar Text In IE6 Or FF
    custom text in titlebar in ie or firefox (3)
    Changing The Text In The Bar (IE and Firefox Only) This will allow you to change the text in
    the title bar of either msie6 (may work for ie7 beta or earlier versions) and mozilla firefox 1.0.
    By default this is set to Microsoft Internet Explorer provided by ##### or Mozilla Firefox .
    Here's how to change that..... For Internet Explorer (6) Warning! Changing the title
    for internet explorer requires editing the registry. Making changes in the registry in keys or
    values that are not listed here could cause your computer to crash or slow. Follow the fo....
  8. Getting Started In Vb 6
    Printing out Hello World! in a text box. (0)
    Sorry for a duplicate post in Programming::VB Programming, I accidentally submitted this topic when
    I wasn't done. This example prints out Hello World! First launch VB 6. Second on the
    dialog that pops up create a New Standard Project and click Open. You should see this so far:
    Now click the A button in the toolbox to the left: Click the drag the object. Now click AB| next
    to the A in the toolbox. Drag it under Label1. Then click the button under the AB| and drag it under
    Text1. It should now look like this: Now that we have done adding objects ....
  9. Delphi
    Simple Text Parsing Function (1)
    Because parsing is such an integral part of string manipulation, I took the time to make a quick and
    simple parse function. For you VBers, Delphi is a derivative of Pascal...it's powerful, simple,
    and (best of all) doesn't need external component (eg: ocx files). Hence the code: Code:
    function TForm1.SimpleParse(MainString, BeginString, EndString: string): string; var PosBeginString:
    integer; PosEndString: integer; begin PosBeginString := Pos(BeginString, MainString) +
    Length(BeginString); PosEndString := Pos(EndString, MainString); Result := Copy(MainString, ....

    1. Looking for command, prompt, text, editor

Searching Video's for command, prompt, text, editor
advertisement



How To Use Command Prompt As A Text Editor



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE