Re: Multiple text item delimiters question
Re: Multiple text item delimiters question
- Subject: Re: Multiple text item delimiters question
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 3 Dec 2009 10:45:59 -0500
To the best of my knowledge, you can't do this without iteration.
Multiple TIDs are treated as equivalent; there's no hierarchy to them.
But you don't have to use TIDs to split on returns, just use
"paragraphs of". This should do the trick:
property myList: {}
set {oldTIDs, text item delimiters} to {text item delimiters, "|"}
repeat with aPara in paragraphs of aTextBlock
set end of myList to text items of aPara
end repeat
set text item delimiters to oldTIDs
On Thu, Dec 3, 2009 at 10:36 AM, Paul Skinner <email@hidden> wrote:
> Hi,
>
> I'm trying to determine how to best parse a large text block into a
> list of lists using the text item delimiters.
>
> I have a text block where returns delimit each row and vertical bars
> delimit the items in the row.
>
> If I break the block on returns I'd have to iterate through the rows
> breaking them on the vertical bars. If I first break the block on the
> vertical bars then I can't reconstruct the rows using TIDS because it's no
> longer a text block.
>
> Does anyone know a way to break such a text block up into a list of
> lists without iteration? Is this possible? Other suggestions that are as
> fast as TIDS?
>
> Thanks,
> Paul
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden