0% found this document useful (0 votes)
8 views10 pages

Text Files

The document discusses the purpose and benefits of storing data in text files, emphasizing that data saved in files is permanent and can be accessed later by the same or different programs. It highlights the advantages of text files, such as eliminating the need for manual data entry and allowing for easy reading and writing of data. Additionally, it mentions the use of specific statements in pseudocode for handling text files.

Uploaded by

dc1901020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views10 pages

Text Files

The document discusses the purpose and benefits of storing data in text files, emphasizing that data saved in files is permanent and can be accessed later by the same or different programs. It highlights the advantages of text files, such as eliminating the need for manual data entry and allowing for easy reading and writing of data. Additionally, it mentions the use of specific statements in pseudocode for handling text files.

Uploaded by

dc1901020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TEXT FILES

Purpose of storing data in a file


•Computer programs store data that will be required again in a file.
•While any data stored in RAM will be lost when the computer is
switched off, when data is saved to a file it is stored permanently.
•Data stored in a file can thus be accessed by the same program at
a later date or accessed by another program.
•Data stored in a file can also be sent to be used on other
computer(s).
•The storage of data in files is one of the most used features of
programming.
Benefits of textfiles
• Data from the arrays is written to the files before
the program is terminated or computer is
switched off
• Data can then be read from the files and written
the arrays
• No need to (re-)enter the data manually - you
only need to enter data once
• Text files contain a sequence of characters.
•Text files can include an end of line character that
enables the file to be read from and written to as
lines of characters.
•In pseudocode, text files are handled using the
following statements.
•To open a file before reading from it or writing to it:
Reading Data from a text file

You might also like