[Newbies] CR and LF in Text files

Michael Ross-1 kmr1642 at yahoo.com
Sun May 24 18:54:33 UTC 2009


This sounds like a variation of the LineEnd problem. 
There are three ways of separating lines in text files-

 CR used in Mac 
 LF used in Unix
 CRLF used in Windows

Squeak chose CR as its standard. I would guess you are reading a file 
made on a Windows platform. Find the method 
  String>>withSqueakLineEndings 
and see if you can apply it to your file's contents before making your Set.

-Michael


jowen wrote:
> 
> I have a simple list of items in a text file with "Enter" separating. 
> When I read them into a Set the first item in the list is picked up
> differently to later occurrences of the same thing.  Hence, one too many
> items in the "Set".  Inspecting shows that later items are proceeded by a
> linefeed character which is why they end up different to the Set than the
> first.  What am I doing wrong?  The same thing works fine in VisualWorks. 
> Thanks.
> 

-- 
View this message in context: http://www.nabble.com/CR-and-LF-in-Text-files-tp23690584p23696842.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.



More information about the Beginners mailing list