• 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 Files containing a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding Files containing a string


  • Subject: Re: Finding Files containing a string
  • From: Wayne Melrose <email@hidden>
  • Date: Mon, 9 Jul 2007 11:33:33 +0200


On 9. jul. 2007, at 10.34, David Bradley wrote:

Hi,

I've been browsing the web for a bit now, trying to find some help on trying to find files that contains a particular string

For example, I would like to find all the files that contain 'I325010' with either a, b, c, d, e, f, etc all the way to z, on the end.
Then be able to use each file that has been found in turn.


Thank you in advance for an help given.

Regards
David Bradley

If your search string remains 'I325010' then you could always just use grep to check for it..


Assuming you're already read your file into a variable (I've used str as the variable name)



set str to "asthisis a string with the search number in it asdfsI325010asdflkjasdlkfj"
set stringFound to true
try
do shell script "echo " & (quoted form of str) & " | grep 'I325010' "
on error
set stringFound to false
end try


if stringFound is true then
        -- do your stuff here
        display dialog "woohoo!"
end if


_______________________________________________ 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
References: 
 >Finding Files containing a string (From: David Bradley <email@hidden>)

  • Prev by Date: Finding Files containing a string
  • Next by Date: Re: Finding Files containing a string
  • Previous by thread: Finding Files containing a string
  • Next by thread: Re: Finding Files containing a string
  • Index(es):
    • Date
    • Thread