Data files can be stored in two ways: • Text files; • Binary files.
Text files A
text file (also called ASCII files) stores information in
ASCII characters. A text file contains human-readable characters. A user can read the contents of a text file or edit it using a text editor. In text files, each line of text is terminated, (delimited) with a special character known as
EOL (End of Line) character. In text files some internal translations take place when this EOL character is read or written.
Examples of text files • A text document (often .txt)
Binary files A
binary file is a file that contains information in the same format in which the information is held in memory, i.e. in the binary form. In a binary file, there is no delimiter for a line. Also no translations occur in binary files. As a result, binary files are faster and easier for a program to read and write than the text files. As long as the file doesn't need to be read or ported to a different type of system, binary files are the best way to store program information.
Examples of binary files • A JPEG image (.jpg or .jpeg) == Data file categories ==