Skip navigation.
 
mlRe: Slice a .txt file in lines
FROM : Sean Murphy
DATE : Tue Jun 20 19:44:46 2006

On Jun 20, 2006, at 11:48 AM, Douglas Davidson wrote:

> This code assumes that the file uses a single line terminator 
> consistently throughout.  Andreas' method will use whatever 
> terminators occur in the file.
>
> One other note is that there are two sets of methods:  one that 
> uses the word "line", and another that uses the word "paragraph". 
> The distinction is because there are line separators that are not 
> paragraph separators, U+0085 NEXT LINE and U+2028 LINE SEPARATOR. 
> This distinction may or may not be important depending on what you 
> are trying to do.


On Jun 20, 2006, at 11:44 AM, Andreas Mayer wrote:

> This assumes that there is only one type of line ending character 
> in a single file.
> I'm not sure this assumption is necessarily true.


Thank you both Douglas and Andreas.  I'm glad I decided to post my 
code, and will keep its limitations in mind (and take this as a 
reminder to write more defensively, minus assumptions). 
Nevertheless, the text files my program is processing are consistent 
with one line terminator, and I guess I just modeled my code with 
that in mind.

Thanks again for taking the time to point those facts out.

-Murph

Related mailsAuthorDate
mlSlice a .txt file in lines Neto Jun 20, 07:44
mlRe: Slice a .txt file in lines Ben Lachman Jun 20, 08:11
mlRe: Slice a .txt file in lines Andreas Mayer Jun 20, 14:38
mlRe: Slice a .txt file in lines Sean Murphy Jun 20, 17:13
mlRe: Slice a .txt file in lines Andreas Mayer Jun 20, 17:44
mlRe: Slice a .txt file in lines Douglas Davidson Jun 20, 17:48
mlRe: Slice a .txt file in lines Sean Murphy Jun 20, 19:44
mlRe: Slice a .txt file in lines Neto Jun 21, 05:59