• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Simple text question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple text question


  • Subject: Re: Simple text question
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 7 Jul 2008 12:56:26 -0700

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]". And this formatting is always at the beginning of the file, so in this case it might be before "6000", but not before "6001"/ Is that correct?


If all that is correct and the number is always four digits long, this will work:

set a to "gibberish6000[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
  • Follow-Ups:
    • RE: Simple text question
      • From: "Script2" <email@hidden>
References: 
 >RE: Simple text question (From: "Script2" <email@hidden>)

  • Prev by Date: RE: Simple text question
  • Next by Date: Re: Simple text question
  • Previous by thread: Re: Simple text question
  • Next by thread: RE: Simple text question
  • Index(es):
    • Date
    • Thread