How to create a text file

Updated: 09/03/2019 past Computer Hope

You lot can create a text file on your computer with a text editor. An example of a text editor is Notepad, which is included with Microsoft Windows.

Notation

When nosotros refer to a "text file" we are talking about a plain text file without any text formatting (e.yard., assuming), images, different fonts, font sizes, etc. If y'all need to create a more rich certificate with whatever of these features see: How to create a document.

Tip

The below recommendations are for programs included with an operating system. You can also download and install a more powerful and free text editor such as Notepad++ to create, view, and edit text files.

Open and utilize Notepad

The easiest style to create a text file in Windows is to open up up the Notepad software program on your computer. The Notepad is a text editor included with Microsoft Windows.

Tip

A text file is considered a plaintext file and Notepad is just capable of creating and editing plaintext files. Notepad saves any text file with a .txt file extension, which means no special formatting or fonts tin be used.

The Windows Notepad programme can exist opened using either of the methods beneath.

  1. Click Start.
  2. In the Run or Search box, blazon Notepad and press Enter.

Or

  1. Click Showtime.
  2. Open up All Programs, Accessories, then click the Notepad shortcut.

Save the file every bit a text file

You can besides create a text file using any other word processing software program, similar Microsoft Word or WordPad. When saving the file, change the file name or file type to Plainly Text to salve it as a text file. In many of these programs, you too accept the option to save the file as a Rich Text Format.

Save As option

After the file is created and saved, it can also be edited using Notepad or another discussion processing software programme.

Create a new text file from the desktop

Another style to create a text file is to correct-click an empty area on the desktop, and in the pop-upward menu, select New, and so select Text Certificate.

Creating a text file this way opens your default text editor with a blank text file on your desktop. You can change the name of the file to annihilation you want. You tin can edit the file in the Notepad program or whatsoever other give-and-take processing software plan, like Microsoft Discussion.

Tip

These same steps tin be used in whatever other location on your computer, for example, another folder.

Create a text file from the Windows command line

While in the Windows command line, you also tin create a new text file in the current directory. With earlier versions of Windows, a new file of any type, including text files, could be created using the edit command line command. Afterwards versions of Windows removed the power to use the edit command for this purpose. Instead, you tin use the echo control at the Windows command line to create an empty text file in the current directory. An example of using this shown below.

echo.>myfile.txt

In the case above, yous are using the repeat command to create a file named "myfile.txt" in the current directory. Note that there are no spaces betwixt echo, the period, the greater-than sign (>), and the file proper noun.

Another choice for creating a text file from the command line is with the start command, equally shown in the instance below.

start notepad myfile.txt

In this case, yous are using the showtime command to open Notepad with the file "myfile.txt". Assuming this file does non exist, it would be created and saved in your current directory. If the file did exist, you would be editing that file.

Create a text file from inside a Linux shell

pico command

Several commands can create a text file in a Linux shell. One easy-to-utilize text editor is pico. You can apply it like this:

pico myfile.txt

After inbound the control above, the editor opens and allows you to create a text file. When washed, press Ctrl+10 to exit the file. When prompted to salvage the file, if you want to keep the file, press "Y" for yes.

Tip

The .txt file extension is non required in Linux. It is a file extension most commonly found and used with Windows. If you practise not demand the file to open in Windows, you can have no file extension or rename it to any yous want.

  • How to open, create, edit, and view a file in Linux.