• 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: Finding lines containing foo in a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding lines containing foo in a file


  • Subject: Re: Finding lines containing foo in a file
  • From: Serge Ségu <email@hidden>
  • Date: Wed, 21 Dec 2005 11:53:44 +0100

Le 21 déc. 2005, à 02:05, Stockly, Ed a écrit :

[...] I need to get every line that contain specific strings. [...] Any vanilla AppleScript* suggestions?

with "classic" style ?

set theLines to every paragraph of (read (choose file))
set {stringToFind, FoundLines} to {{"misc1", "misc2"}, {}}
with timeout of (10 * minutes) seconds
	repeat with oneLine in theLines
		repeat with oneString in stringToFind
			if oneString is in oneLine then ¬
				set FoundLines to FoundLines & oneLine
		end repeat
	end repeat
end timeout
return FoundLines

--
Serge Ségu

_______________________________________________
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


References: 
 >Finding lines containing foo in a file (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Finding lines containing foo in a file
  • Next by Date: Re: Finding lines containing foo in a file
  • Previous by thread: Re: Finding lines containing foo in a file
  • Next by thread: Re: Finding lines containing foo in a file
  • Index(es):
    • Date
    • Thread