I have a large textfile, which has linebreaks at column 80 due to console width. Many of the lines in the textfile are not 80 characters long, and are not affected by the linebreak. In pseudocode, this is what I want:
- Iterate through lines in file
- If line matches this regex pattern: ^(.{80})\n(.+)
- Replace this line with a new string consisting of match.group(1) and match.group(2). Just remove the linebreak from this line.
- If line doesn't match the regex, skip!
Maybe I don't need regex to do this?