Details:
You will be creating a program to read a CSV type file, grab some of its contents, and write a CSV type file as a response.
Your program will be executed on the command line (not in a Jupyter notebook). Its given command-line arguments will be
input-filename
output-filename
line-number (an integer)
It will open and read lines from the named inputfile -- the lines will be in CSV (comma-separated-values) format (the first line in the inputfile is line-number 0)
It will write a single CSV-formatted line to the outputfile containing only the positive numbers it found on the specified line, in the order it found them
Restrictions: the only library you're allowed to import is the necessary sys libary (which your program needs to obtain the command-line arguments off the command-line). You MUST import that library with the command import sys - anything else will give the Program Tester indigestion.
Example:
For this example, assume that there is a file called fred.csv containing the following lines:
5,Hello,45,,12
43,-7,World of Mine!,12,a,9
Yo,3,200
Assume that you have program called blarp.py that performs the task
outlined above. Then you or I can call your program, from the command-line
in the following way:
python blarp.py
fred.csv george.csv 1
or
python3 blarp.py fred.csv george.csv
1
...and it will succesfully write a file called george.py which contains the single line:
43,12,9
Suggestions:
Try writing programs that can be executed from the command-line, and that will read and write files
learn to use the sys.argv array to read command-line arguments
you may want to brush up on the following string methods: .split() and .isdigit()
get comfortable with CSV formatted data...there's lots more coming