Re: TIDs Inquiry
Re: TIDs Inquiry
- Subject: Re: TIDs Inquiry
- From: Axel Luttgens <email@hidden>
- Date: Mon, 11 Nov 2002 11:53:54 +0100
David wrote:
[snip: intro + code]
For example:
data that is read from a .txt file made by TextEdit using System Mac
OS 10.2.1
TextEdit's default preferences lead to rtf files, with extension hidden.
But you surely knew that.
I'll assume that the text files you created had linefeeds line endings
(ascii 10).
Example a)
a
b
c
d
Example b)
a,b,c,d
Example a would show a 1 item list while example b would appear as a
four item list. Am I correct in assuming that example a *should* show
up as a four item list? As I mentioned earlier, if example a was
pasted into a variable the result would also match the behavior that I
have described for example b.
You didn't show us the way you use your two handlers.
On the other hand, they seem to be perfectly correct.
Just using your handlers:
set LF to ASCII character 10
set linefeedsData to readFile("pathtoexamplea")
getTextItems(linefeedsData, LF)
--> {"a","b","c","d"}
getTextItems(linefeedsData, return)
-->{"a\nb\nc\nd"} where \n indicates a linefeed char
getTextItems(linefeedsData, ",")
-->{"a\nb\nc\nd"}
set commasData to readFile("pathtoexampleb")
getTextItems(commasData, LF)
--> {"a,b,c,d"}
getTextItems(commasData, return)
--> {"a,b,c,d"}
getTextItems(commasData, ",")
--> {"a","b","c",d"}
HTH
_______________________________________________
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.