Re: BUG: More on C-header text files - CORRECTION
Re: BUG: More on C-header text files - CORRECTION
- Subject: Re: BUG: More on C-header text files - CORRECTION
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 22 Jun 2002 08:47:48 -0700
On 6/21/02 11:26 PM, I wrote:
>
I have just discovered that in OS X, at any rate, a text file (including
>
CSV files) brought over from Windows to the Mac and duplicated in the
>
Finder by pressing command-D changes all the CRLF Windows line-endings to
>
CR Mac line endings. This completely buggers up any scripts that expect
>
CRLFs. It's possible to side-step this (from OS 10.1 on) by getting
>
'paragraphs' instead of using CRLF as a text item delimiter, but that
>
won't work in OS 8.x - 9.1 when the line-ending might indeed be CRLF.
>
These text files are all seen by OS X as "C-header files" but i don't
>
think that has anything to do with it.
>
>
Duplicate should mean "duplicate" - copy. The Finder should not be
>
stripping out the LFs when you ask it to copy. Where does one report a
>
bug of this sort (not AppleScript)?
>
I must apologize for what now appears to be an incorrect "finding" last
night. After some inquiries from and checking by Bill Fancher, I tried again
this morning. This is what I found:
I went back to the two emails I was sent by a user: one where the CSV file
attachment was unstuffed, coming through my mac.com email address, the other
the same file sent by the user, but stuffed (came via silcom).
The first file I was sent by the user, not stuffed, has CR line endings.
The second file (stuffed), when unstuffed, has CRLFs. Duplicating it did NOT
strip the strip the LFs.
So it looks as if I may have got confused last night, and that all the
copies with CRs were actually copies of the first file. Since the same user
sent the same file both times, it looks as if my first guess - that a mail
server (his SMTP or, quite likely my mac.com IMAP sever, or somewhere
enroute) stripped out the LFs, was in fact correct. Probably the "copy" I
found to have just CRs was a copy of the first file, not the second.
In any case, I'm glad I discovered this, since many people are likely to be
sending themselves the file by email. In most scenarios, they will creating
it in Outlook Windows, then sending it to themselves, probably not zipped,
and will receive it on their Mac. In some cases, they too will find that
email has stripped out the LFs.
My script now looks for the characters after the first 'paragraph'. If the
second character after it is an LF, the script sets a variable to (return &
(ASCII character 10), otherwise it sets the variable to (return). It works
fine with both versions of the file.
Sorry for the red herring. I thought I was being careful last night, but it
was very late here.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.