<\/p>\n
In this assignment we will write the simple getcol tool in Python 3. It extracts a subset of columns of data from a file which has data organized in columns. It is a lot like the tool we built in class. But it has more options and features so you can practice parsing and processing options and then using Python 3.<\/p>\n
Here is the help message which is gotten by the default -h option:<\/p>\n
Usage: getcol [options] {col{:col{:col}}}*\n\nOptions:\n -h, --help show this help message and exit\n -i STR, --insep=STR input separator\n -o STR, --outsep=STR output separator\n -l STR, --lastsep=STR\n last output separator\n -s strip each input column of whitespace\n<\/pre>\n
As many columns as desired can be specified on the command line in a list of columns. Columns are numbered starting at 1. Duplicate column numbers are allowed! The columns are printed in the order they are specified in the column list.<\/p>\n
Furthermore each column specifier in the the column list may have zero, one, or two separating colons with no whitespace between. So the column specifier may be a num or num:num or num:num:num. These mean:<\/p>\n
An example column specification might be: 2 2 10:11 8:12:2 10 which would print columns: 2, 2, 10, 11, 8, 10, 12, 10 Consider implementing this feature with the range function.<\/p>\n
To test your code and better understand the definition of the functions there is a tar\/zip in the sidebar that contains test scripts and a makefile for this assignment.<\/p>\n
Homework will be submitted as an uncompressed<\/strong> tar file to the homework submission page linked from the main class page. No makefile is needed for a Python program. Your pogram will be named getcol with no py extension. To invoke Python 3 you put:<\/p>\n as the first line of your program. This will let you use the python3 that is installed in local environment. FYI: it is Python 3.4. Have fun.<\/p>\n You can submit as many times as you like. The LAST file you submit BEFORE the deadline will be the one graded.<\/strong> For all submissions you will receive email giving you some automated feedback on the unpacking and compiling and running of code and possibly some other things that can be autotested. I will read the results of the runs and the reports you submit.<\/p>\n Have fun.<\/p>\n#!\/usr\/bin\/env python3 \n<\/pre>\n