INTRODUCTION

Almost every computer user encounters the need to prepare certain documents - letters, articles, memos, reports, advertising materials, etc. Of course, these documents can be prepared without a computer, for example on a typewriter. However, with the advent personal computers It has become much easier and more convenient, and therefore more profitable, to prepare documents using computers.

When using personal computers to prepare documents, the text of the document being edited is displayed on the screen, and the user can make changes to it online. All changes made are immediately displayed on the computer screen, and then when printed, beautiful and correctly formatted text is displayed, which takes into account all the corrections made by the user. The user can transfer pieces of text from one place in the document to another, use several types of fonts to highlight individual sections of text, and print the prepared document on a printer in the required number of copies.

The convenience and efficiency of using computers for preparing texts has led to the creation of many programs for document processing. Such programs are called text editors(Word Processors). The capabilities of these programs are varied - from programs designed for preparing small documents of a simple structure, to programs for typing, design and complete preparation for printing of books and magazines (publishing systems).


Before you start exploring the MS-DOS Editor menu, you should practice typing. The text is typed from the keyboard as on a regular typewriter; at the end of each line, Enter is pressed.

To split a line that is too long into two, press Enter where the end of the line should be.

Each press of Enter adds a blank line. If excess are formed empty lines, delete them you can press Shay Del.

You can correct errors in the text by moving the cursor across the working field using the keys or mouse. To delete a character, use the Del key if the cursor is before the character you want to delete, or the Backspace key if the cursor is after the character.

If you need to delete a character only to type another in its place, it is more convenient to switch the keyboard to replacement mode. By default, the keyboard is in insert mode. The Ins key switches between insert and replace modes.

When inserted, all subsequent characters are shifted to the right.

When replaced, the current character disappears.

Documents created in the MS-DOS Editor can be saved in text files; to do this, use the menu File Save. The File Save As... menu will allow you to save the file under a different name.

To clear the editor and start working on a new file, use the menu File New. To load a ready-made file into the editor, use the menu File Open. In the dialog panel, select the name of the required file with the cursor. Menu File Print allows you to print either a selected part of a document or the entire text.

Among simple editors LEXICON is the most widely used text in Russia.

Word processor Lexicon

Lexicon word processor developed E.N.Veselov in 1985 at the Computing Center of the USSR Academy of Sciences. Since 1991 supplied by the company Microinform. It has an interface in Russian and allows you to prepare simple documents with text in Russian and English languages. LEXICON successfully fills its “ecological niche” - it is quite suitable for those who need a simple tool for preparing small and uncomplicated documents, and they do not require high printing quality.

To start working on a new file, you need to give the menu command Clear text or use any free Lexicon window. There are a total of 10 windows available, and by pressing A + "qi fra on the alphanumeric keyboard, you can go to the window with the corresponding number.

To load a ready-made file, use the menu command Download text and select the name of the required file in the menu with the cursor.

Menu command Print text t Start will allow you to print a document on a printer if the PRINTER1FILE 1SCREEN switch is set to the PRINTER position. When in the SCREEN position, you can see exactly how the text printed on the printer will look.

Editor MS-Word

Here are just some of the features supported by Word:

· use of many different fonts (sizes and styles) of characters and different ways of highlighting them (bold, italic, underlined characters, etc.); specifying the parameters of text paragraphs and document pages; typing text in several columns; printing headers and footers of any type; automatic generation of a table of contents and various types of indexes;

· design of tables and paragraphs “side by side”; inclusion of drawings ( graphic files); placing paragraphs (for example, pictures) anywhere on the page (the rest of the text can “bend around” the picture).

Experienced users really appreciate Word's style features. Word allows you to record in the so-called style sheet all the parameters of the most commonly used types of text formatting: paragraphs, characters and document sections. If you do this, then any part of the text can be assigned one of the “standard” design types using one or two keystrokes. This not only significantly speeds up document typing, but also increases the flexibility of its design. For example, to change the font and location of all headings of a certain level (say, paragraph headings), you do not need to search for these headings and manually change their formatting - just correct the style for these headings, and they will automatically take the desired design.

Shift+Ctri with "M""1", "N""WITH", «(» and "5" (on the right side of the keyboard) are reserved.

In fact, there are many more “forbidden” combinations. If you define combinations with Shift for your programs, then from time to time the user will completely unexpectedly “fall out” of the text editor when trying to write a capital letter, and combinations with Alt will not be in vain when working in programs where menu options are called up by Alt+letter- just like in MS-DOS Shell itself. IN Microsoft Word almost all are reserved for internal needs possible combinations keys!

The task switcher itself is a DOSSWAP.EXE program that loads before any application program is executed and exits after the program exits, returning to MS-DOS Shell. The DOSSWAP program takes up about 30 KB of RAM.

The set of rules by which data is stored in a file is called a file format. Different types of files, such as text files, raster graphics, etc., use different formats. In general, several different formats can be defined for the same file type, although file type and format often mean the same thing. A file format is identified by the file name extension that is added to the file name when it is saved in a specific format, such as DOC, GIF, etc.

Typically, file formats are created for use in a strictly defined application program. For example, graphic objects created in a well-known package vector graphics CorelDRAW, saved as files with CDR extension, and images generated by another graphics package, CorelXara, are written to disk as files with the XAR extension. Some formats are not associated with specific applications, that is, they are universal. One of the most well-known universal formats is the TXT format (DOS text file format).

Compression is often used computer files to save storage space. There are many ways to compress files. These methods depend on the source file format. In general, the higher the compression ratio, the slower read and write operations are.

As for compression algorithms, there are both compression algorithms without data loss and algorithms that may result in data loss.

Lossless compression ensures that all the data that was in the file before compression will be present after the file is decompressed. Lossless compression mechanisms are used when storing text or numeric data, such as spreadsheets or document files. Examples of lossless compression algorithms include the well-known algorithms ZIP, ARJ, and others.

Let's give brief description main formats used:

§ American Standard Code for Information Interchange ASCII (TXT). Text file format developed by the American National Standards Institute. Supported by everyone operating systems and all programs. It is a text file in DOS encoding, there is no function to insert a picture, there is no formatting, it works on all machines, it is possible to create only small files.



§ ANSI (TXT). Text file format in ANSI encoding (for encoding Microsoft pages Windows)

§ MsWord for DOS, Windows (.DOC). The document format, developed by Microsoft Corporation, is supported by MS-DOS programs and most word processors. It preserves the original formatting of documents, as well as character styles. Except text information, files of this format can contain graphic images with various parameters. Supports 256 colors. Does not support compression. Used primarily for exchanging formatted text data between different platforms and applications.

§ Hypertext Markup Language HTML (HTM, HTML). Markup language for hypertext documents. All pages located on the Internet are created using this special language. HTML documents are ASCII files that can be viewed and edited in any text editor. Difference from usual text file is that HTML documents contain special tag commands that define the document formatting rule. If you managed to master HTML language, then you can create pages for the Internet. By adding tags (labels) to plain text, you force the viewer to display that text in a certain way and place images on the page. If you've learned Java and JavaScript, you know how to extend HTML by placing commands written in a scripting language inside tags.

§ Portable Document Format PDF (.PDF). This document storage format, developed by Adobe, claims to be an open typographic standard for the Web. It is seen as an alternative to HTML. The disadvantage of HTML is that documents translated into HTML usually do not retain the original format, and HTML offers a very limited number of fonts when viewed. In contrast, users of Acrobat and PDF tools for creating, sharing, and viewing documents in their original format know that readers will see the publication exactly as it was created. PDF format indispensable if you need to obtain an exact copy of the required document. As an example of the successful use of PDF for documents in Russian, we will give the Moscow News server on the Internet. The materials presented on it in electronic form completely replicate the printed paper original.

§ Standard Generalized Markup Language (SGML). The development of HTML translates into a standard generalized markup language. It is a toolkit of mechanisms for creating structured documents marked using descriptors (tags). Compared to HTML, it provides more flexible and versatile formatting options on the Web. However, SGML also has increased speed, so PDF is used as a simpler tool. The power of SGML lies in its cross-platform structured approach to describing the content of documents. SGML is actually a metalanguage, i.e. is intended to describe markup languages ​​used to create documents.

Text files consist of variable-length character strings. Each line ends with a special combination called "end of line". The "end of line" combination consists of two characters: "carriage return" (ASCII code #13) and "line feed" (#10). The text file ends with the "end of file" symbol (#26).

A text file is described by declaring a variable of type Text:

var file_variable: Text;

Reading from a text file is carried out using the Read and ReadLn operators. To read data from a file, specify the name of the file variable as the first parameter, and then, separated by commas, the variables into which data is read from the file are listed. In a text file, data is stored in string form. However, if a data item can be converted to a number, this conversion occurs automatically when entered into numeric variables. Numeric data elements on lines in a text file are separated by spaces or tab characters. If a file line has ended, and the input list consisting of numeric or character variables in the Read statement has not been exhausted, then input continues from the next line. When entering data from a text file into character variables, the data elements are not separated. If in the data list there is a string variable after a numeric variable, then the space that follows the numeric value in the file is read into a string (the same is true when reading into a character variable).

The difference between the Read and ReadLn operators when reading from text files is that the ReadLn operator, having placed the value in the last variable of the input list, moves to the beginning of the next line without reading the remaining data in the line. On the other hand, the Read statement remains ready to read data from the next position of the current line. So, suppose there are two lines in the text file f:

1 - 2 4

In this case, two statements Read(f,m); Read(f,n); will place the values ​​1 and -2 into integer variables m and n, respectively, and two operators ReadLn(f,m); ReadLn(f,n); count values ​​1 and 4.

Example. In the text file f.txt, integer numbers are separated by spaces. Rewrite all numbers from the f.txt file into the f1.txt file, except for the maximum ones (it is assumed that there may be several of them).

var f, f1: Text; a, max: LongInt ; flag: Boolean; begin Assign(f, "f.txt" ) ; Reset(f); while not Eof (f) do begin Read (f, a) ; if a>max then max : = a; end ; Assign(f1, "f1.txt" ) ; Rewrite(f1) ; Reset(f); while not Eof (f) do begin Read (f, a) ; if a<>max then WriteLn (f1, a) ; end ; Close(f) ; Close(f1) ; end.

In the example, the f.txt file is read twice. The first time is to determine the maximum number, the second time is to read the numbers and write them to the second file. This algorithm is used if there are several maximum numbers in the file.

The peculiarity of text files is that they are sequential access files: you cannot read any element of a text file without reading all previous elements. Similarly, you cannot write information to a text file in an arbitrary manner; you can only write to it sequentially.

The TXT format is the most common format for storing and transmitting text data after . A TXT file can be a formatted/unformatted block of text information, implemented as a sequence of lines.

Formatting tools can be applied to any text block of such information and set: font size and style, size line spacing, as well as other style elements depending on the user's needs.

In OS Windows file TXT is called “ Text document" If the TXT file is in the installed software package, it will have the name “ Readme” (in the vast majority of cases).

TXT is the most basic format for representing text data, but it is the basis for more specialized extensions such as , and .

Text document TXT can support editing not only on PCs with different OS (Windows, Mac, Linux), but also on mobile devices ah iPhone and iPad Android system. Also, Txt e-books are supported on mobile platforms.

Programs for opening TXT files

Txt program for most Windows OS users is traditional “ Notebook" or standard means Microsoft Office (MS Word).

It is very noteworthy that work with the TXT extension is implemented on most Internet browsers ( Internet Explorer , Opera etc.). Other common applications (for which you first need to download a Txt document) that support creating/opening/editing files include:

  • Staroffice (Windows OS);
  • Geany (Windows OS);
  • (Windows OS);
  • Apple textedit (Mac OS);
  • Caliber (Mac OS);
  • Planamesa neooffice (Mac OS);
  • gedit (Linux OS);
  • Kwrite (Linux OS).

To display text information on iPhone screen, iPad or other mobile devices, one of the programs Kingsoft office for Android or Officesuite viewer can be used.

How to convert TXT to other formats

  • TXT -> ASCII (recommended software - Microsoft windows notepad);
  • TXT -> ASC, TXT -> AWW (recommended software - Ability write);
  • TXT -> CBR (recommended software - Free online file conversion);
  • TXT -> DOC, TXT -> DOCX, TXT -> ODT, TXT -> PDF, TXT -> RTF (recommended software -);
  • TXT -> EPUB, TXT -> SNB (recommended software - Caliber);
  • TXT -> LWP (recommended software - Ability write).

This software supports its operation on Windows OS.

Why TXT and what are its advantages?

We can say that the TXT extension is one of the most universal formats for storing and transmitting text information. TXT files are perfectly adapted to a wide variety of text editors, including internal OS applications.

A text file can be thought of as a sequence of characters, divided into lines ranging from 0 to 256 characters in length. These are sequential access files. The structural unit of text files is a line. The data in such files is stored as a chain of ASCII codes and can be processed by any text editor. Each line ends with an end-of-line marker. In practice, such a marker is a sequence of two characters: linefeedchr(10) and carriage returnchr(13). These two characters define standard actions for managing text files.

Text files are described in the variable description section:

File_variable: TextFile;

A file variable is a variable name that is used in program code to work with the file.

Opening a text file

Before you can write data to a file or read data from a file, you must first open the file. Opening a text file for writing, reading or writing is carried out using different procedures. But before using them, it is necessary in all cases to assign a name to the file on the magnetic medium, i.e. assign a file variable to the name of a file on disk using the procedure AssignFile:

AssignFile(file variable, filename),

Here the file name is any expression of string type, which is constructed according to the rules for defining names in the operating system.

For example:

AssignFile(F,’c:\Student\Primer.Txt’);

Procedures for opening text files

Referring to the procedure

Action

Opens (creates) new file. The file name is predetermined in the AssignFile procedure. If there was already a file with the same name on the disk, it is destroyed.

Opens an already existing file. The file is read sequentially. If this procedure is applied to a non-existent file, an I/O error occurs.

Opens an existing file for addition. The recording is made at the end of the file.

In the table F is the name of the file variable.

Processing text files

Text files have their own specifics. Special extensions to the standard Read and Write procedures described below allow you to work with non-character type values. In other words, the sequence of characters is automatically converted to the value of the type of variable that is used in file operations.

The call Read(F,Ww), where Ww is a variable of type word, reads a sequence of digits from file F, which is then interpreted into a number, the value of which will be assigned to the variable Ww. If instead of a sequence of numbers there is any other sequence of characters, the use of such an operator results in a program execution error.

In table F is the name of the file variable. V1, V2,…, Vn are variables of different types.

Referring to the procedure

Action

Read(F,V1[,V2,…,Vn]);

Reads character strings from a disk file into the variables V1, V2,…,Vn.

Readln(F,V1[,V2,…,Vn]);

Read, and additionally – reading to the end of line marker and moving to a new line

Readln(F) without a list of variables allows you to skip a line in a file and go to a new line.

Write(F,V1[,V2,…,Vn]);

Writes the values ​​of the variables V1,V2,…,Vn to a file on disk.

Writeln(F,V1[,V2,…,Vn]);

Performs the same actions as Write, but ensures that all values ​​are recorded with the obligatory installation of an end-of-line marker in the file.

Writeln(F) without list of variables . writes an empty string to the file.


Close