Hi Michelle
See below answers to your questions.
Ruby
-----Original Message-----
From: applescript-users-bounces+script2=email@hidden
[mailto:applescript-users-bounces+script2=email@hidden] On
Behalf Of Michelle Steiner
Sent: Monday, July 07, 2008 3:56 PM
To: Applescript Users
Subject: Re: Simple text question
On Jul 7, 2008, at 12:33 PM, Script2 wrote:
> This file comes from various software's' (M. Word, quark..), in
some
> cases
> there might be some formatting junk before "6000[F]this"
which I
> want to
> strip out. I thought If I could figure out the position of
> "6000[F]this" (by
> word count) then I could copy the paragraph from word x to end
of
> paragraph.
> This file can be 25 to 300 paragraphs long. The numbers before
the
> [F] can
> be between 1 to 7000 and the word "[F]" can be any word,
and no space
> between 6001[F]this.
If I understand you correctly, you want to strip out any
formatting
that might be before the number, but you want to retain the number
and
"[F]".correct
And this formatting is always at the beginning of the file correct
so far I have not seen at end of paragraph, so
in this case it might be before "6000", but not before
"6001"/ Is
that correct? correct
If all that is correct and the number is always four digits long,
this
will work: The number can be 1,2,3 or
4 digits long.
set a to "gibberish 6000[F]this is test (#1).
6001[F]this is test (#2)."
set offst to offset of "[" in a
if offst is greater than 5 then
set a to text offst through end of a
end if
If all that is not correct, you will need to better explain what
you're trying to accomplish.
-- Michelle
--
Help, I've caught a cult, and can't get out!
_______________________________________________
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