Files
Description
Write two programs to handle binary data:
encode-data
: Convert a file of comma-separated data into a binary encoded file.read-data
: Print a specific range of records from a binary encoded file created by theencode-data
program.
For this assignment, we will use the following dataset:
Pokémon for Data Mining and Machine Learning.
You are allowed to hard-code assumptions based on this data. A modified copy
of the data is on the Linux server here:
/export/home/public/schwesin/cpsc552/data/
General Specifications
The default make target should create both executables.
Your programs must all be properly modular and documented appropriately.
Each program must use a different family of functions for file I/O. That is, one program must use file descriptors and the other program
FILE
pointers. You can choose which program uses which method.
encode-data
Specifications
The name of the compiled program must be
encode-data
.The input to the program must be in the form of command line arguments as follows:
-h
(by itself with no other arguments) print the usage instructions-i <string>
(required) the input CSV file-o <string>
(required) the output binary file
Note that the command line arguments must be able to be entered in any arbitrary order,
read-data
Specifications
The name of the compiled program must be
read-data
.The input to the program must be in the form of command line arguments as follows:
-h
(by itself with no other arguments) print the usage instructions-f <string>
(required) the input binary file-n <integer>
(required) the first record in the range-m <integer>
(required) the last record in the range
Note that the command line arguments must be able to be entered in any arbitrary order.
Write the records in a well-labeled, human readable format.
A given record should be accessed with a seek; only one record may be in memory at a time.
Turning in the Assignment
For this assignment, you must turn in a zip file of a directory named
project1
containing the appropriate files.
Submit the zip file to the appropriate folder on D2L.