The content is just an excerpt from the complete note for SS2 Second Term Computer Studies Lesson Note – Handling Computer Files I. Check below to download the complete DOCUMENT
WEEK: 4
TOPIC: HANDLING COMPUTER FILES I (PRACTICAL)
CONTENT: (a) Basic operations on computer files (b) Steps involved in creating sequential files (c) Steps involved in accessing sequential file (d) basic file processing statements (e) effects of file insecurity: data loss and insecurity.
Sub-Topic 1: BASIC OPERATIONS ON A COMPUTER FILE.
The following are some operations that can be performed on a computer file;
- File creation: Creating a file with a given name
- File Deletion: Deleting files that are no longer wanted
- File retrieval: Retrieving a lose file or stored file.
- File copy: Copying a created file to either an external or in-built storage device.
- File view: Viewing a created file or granting privilege of viewing.
- File Update: Reading or changing the content of a file.
- File Open: Opening the content of a file on the screen.
- File Close: Losing access to a file by closing, until it is opened again.
Sub-Topic 2: STEPS INVOLVED IN CREATING AND ACCESSING SEQUENTIAL FILES.
Meaning of Sequential File: A sequential file is a file that is read from start to finish, character by character or line by line in a chronological order.
The following are steps involved in the creation of sequential files:
- Open the file in Output(0) mode i.e. OPEN “0” #1” filename
- OPEN
- The OPEN command is used to open files – that is, it makes files available so that Basic can read or write to them. The general form of the command is
OPEN “filename” FOR mode AS #filenumber. |
- Write data to the file using the PRINT# or WRITE# statements:
PRINT#1, A$
PRINT#1, B$
PRINT#1, C$
- To access the data in the file, you must close the file and reopen it in input mode: CLOSE#1
OPEN “I”, #1,” filename
- Use the INPUT# or LINE INPUT# statement to the read data from the sequential file into the program:
INPUT#, X$,Y$,Z$
To gain full access to the note: DOWNLOAD FILE