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:

  1. Open the file in Output(0) mode i.e. OPEN “0” #1” filename
  2. OPEN
  3. 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
SEE ALSO  SS1 Third Term Biology Lesson Note – The Organism and Its Environment
OPEN “filename” FOR mode AS #filenumber.
  1. Write data to the file using the PRINT# or WRITE# statements:

PRINT#1, A$

PRINT#1, B$

PRINT#1, C$

  1. To access the data in the file, you must close the file and reopen it in input mode: CLOSE#1

             OPEN “I”, #1,” filename

  1. 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

Copyright warnings! Do not copy.