in reply to Break continuous lines of a text file based on character lengths

how do you define a line? if it's as simple as 'a dot marks the end of a line' then you would
- read in the file at once (1)
- substitute dots with a dot and a newline
- print string to newly opened file (2)

(1) might be more efficient to set $/ to '.' if the file is large, and then read into an array line by line
(2) use file locking and don't close the file in between, if that's necessary, e.g. if more than one process might open the file

if you're having problems with one of the steps you're welcome to add specific questions.
something to read: perlopentut, perlre, flock

  • Comment on Re: Break continuous lines of a text file based on character lengths