TXT file
A text file (sometimes spelled textfile; an old alternative name is flatfile) is a type of computer file that is structured as a sequence of lines of electronic text. A text file exists stored as data within a computer file system. On operating systems such as CP/M and MS-DOS, where the operating system does not keep track of the file size in bytes, the end of a text file is indicated by placing one or more special characters, known as an end-of-file marker, as a filler after the last line of a text file. On modern operating systems such as Microsoft Windows and Unix-like systems, text files do not contain any special EOF characters because the file systems on those operating systems keep track of the file size in bytes. Most text files need to have end-of-line delimiters, which are done in a few different ways depending on the operating system. Some operating systems with record-oriented file systems may not use line delimiters and will primarily store text files with separate lines as fixed- or variable-length records.
"Text file" refers to a container type, while plain text refers to a content type.
At a generic level of description, there are two types of computer files: text files and binary files.
Because of their simplicity, text files are commonly used for storing information. They avoid some of the problems encountered with other file formats, such as endianness, fill bytes or differences in the number of bytes in a machine word. In addition, when data corruption occurs in a text file, it is often easier to recover and continue processing the remaining contents. A disadvantage of text files is that they usually have a low entropy, which means that the information takes up more memory than is strictly necessary.
A simple text file may not need additional metadata (other than knowledge of its character set) to assist the reader in interpretation. A text file may contain no data at all, which is a case of a zero-byte file.