Using A Text Editor

The are many development environments available for programming but recomend not using them for writing code. In many cases, like Visual C++ code is added to projects by the development environment confusing the new programmer. In the case of Visual Basic all of the code for the main structure of a program is created for the programmer and hidden. If you really want to understand the code and how it works, create all programs from scratch with a text editor. Some examples of programming source code that can be edited with a text editor:


Beyond programming, it is possible to open almost any file as text. For example, if you are using Windows and MSOffice try opening a Word document in Notepad. There are several ways of doing this:
Once open you will notice many lines of odd characters, like:
þÿ—;âê¸ÃÈÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Scroll down further and you will start to see the actual text of the Word document. You also may see a directory name of where the file is stored, the names of fonts used in the file, the name of the person who wrote the file, and other information. The strange characters and the other information tell your system what kind of file it is and how to display it. Much of this information can also be seen by right clicking on the file icon and clicking Properties. Modifying any of the information in the file through the text viewer can corrupt the file. Try this with other types of files like .JPG or .GIF to see the differences.

Uses of Text Editors

Editing HTML in text

FrontPage and other web publish software add a lot of junk to your HTML files that you do not need and may have trouble understanding. To create a new HTML file in Windows do either of the following:
Right-click a blank space(like on the Desktop) and select New..., Text file. The icon will appear ready to be renamed. Call it whatever you want, but be sure to replace the .TXT with .HTML.

OR

Open Notepad, enter your HTML code and be sure to save it as an *.HTML file by adding the extension to the file name and change the "Save as type:" to "All Files"

You may use the above to create almost any type of file by substituting .TXT with .CPP, .JAVA, .SQL, etc...

To grab the text source of a web page, in the browser go to File, Save as... and select "Web Page, HTML only" from the "Save as type:", not "Web Page, complete." "Web Page, complete" will create a folder with all the images on the web page and save them to your disk.

If you just want the text of a web page(not the HTML source code), save it as "Text Only"

Convert documents from one platform to another

If you have to move a file(say WordPerfect or Word) to some other system that does not have that program, go to File and save it as "Text only" being sure to use .TXT as the file extension. You text-only document is now portable.

Strip-out unwanted formatting

Have a document with stupid fonts, colors and crazy indentations? Just want the text? Choose Select all from the Edit menu then copy it to Notepad, the formatting is gone(you may still have strange line breaks and spacing).


Types of Text Viewers

Notepad

Standard with Windows and has some great features in later releases.

Go To... In the Edit menu "Go To..." opens a dialog box displaying the current line number. Enter any line number and click "Ok" to move the cursor to that line. This is very useful when you get a an error message that directs you to a specific line.

Find/Replace There are two options in Edit menu, "Find..." and "Replace...". Find will locate a text string or character. Replace will find a text string or character and repalce it with a designated string or character. For example, suppose you have a file with "Joe Brown" on many lines nad want to change them all to "Mr. Brown." Put "Joe Brown" in the "Find what" field and "Mr. Brown" in the "Replace with" field.

I believe these are only available with version 5.0 or greater.

Wordpad

DOS Edit

pico

emacs

vi