• 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: "Script2" <email@hidden>
  • Date: Mon, 7 Jul 2008 16:05:22 -0400
  • Importance: Normal

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

 _______________________________________________
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: "Mark J. Reed" <email@hidden>
References: 
 >Re: Simple text question (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Simple text question
  • Next by Date: Re: set understanding to (get explanation)
  • Previous by thread: Re: Simple text question
  • Next by thread: Re: Simple text question
  • Index(es):
    • Date
    • Thread