See Appendix A, Exercise Answers for answers.
Write a program that reads a file containing a list of lines composed of a user name, a company name, and an email address separated by colons. A sample line might look like this:
John Doe:Foo Technologies:[email protected]
Print out each field in formatted columns. Use format
and write
.
Add a top-of-page format to the previous program. (If your file is relatively short, you might need to set the pagelength to something like 10 lines so that you can get multiple instances of the top-of-page.)
Add a sequentially increasing page number to the top-of-page, so that you get page
1
, page 2
, and so on, in the output.