Re: How to parse a textfile ?
Re: How to parse a textfile ?
- Subject: Re: How to parse a textfile ?
- From: Michelle Steiner <email@hidden>
- Date: Tue, 28 Sep 2004 11:17:32 -0700
On Sep 28, 2004, at 6:43 AM, Stefan Eriksson wrote:
any suggestions, parsing text in AS seems lika a major pain...
Here is a vanilla applescript way of doing it; the script relies on the
assumption that no line before the date line has a hyphen in the fifth
position.
set foo to paragraphs of ¬
"blah
blah
2004-09-15
00509562/00000147
11548
blah
blah"
repeat with i from 1 to (count foo)
if (count of item i of foo) is greater than 5 and ¬
character 5 of item i of foo is "-" then
return item (i + 1) of foo
exit repeat
end if
end repeat
--
Stop Mad Cowboy Disease: Vote for Kerry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden