Hi Anette,

you wouldn't have obtained that list of fruit from a Windows box by any
chance? I would guess that the "extra character" is probably a line feed.
Windows machines use "CRLF" (carriage return + line feed) as line separator,
while the pre-OSX mac convention is a bare "CR".

The reason your file will look fine in BBEdit is because it's hiding this
difference in line ending from you. It just "does the clever thing" with
such differences, preserving the line ending when saving and so on. Hmm, so
what to do...

You could just save the "fruit" file so that it has mac line endings:
BBEdit's "options..." under "Save As..." is probably the easiest way to do
that.

Then I think your script should work fine.

Cheers,
Paul
  
    


Reply via email to