Project #1
Some text files come with long lines.
Create a program to
- read a text file with long lines
- split each long line
- assume a maximum line length (80?, 74?, 70?, 64?)
- split each long line into shorter lines
- shorter lines should no exceed the specified length
- do not split words, split on word boundaries
- no need to split short lines
- output a new file with the shorter lines
Project #2
Create and interactive program
- let the user select the maximum line length
(set limits?)
- let the user select the input file
- let the user select the output file
Possible Text Files For Testing
Declaration of Independence
United States Constitution
other text file(s)
Things to Think About
1. how to distinguish words in a text file?
(separated/terminated by spaces, punctuation, EOS, EOF?)
2. paragraph breaks (blank line?)
3. What to do if an error occurs (sentence can not be split?)
(print error message? delete new file?)
4. collect statistics on sentence length?
Note:
- EOS - End of String
- EOF - End of file