• 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: Find text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Find text


  • Subject: RE: Find text
  • From: Javi Pérez <email@hidden>
  • Date: Fri, 20 Apr 2012 16:58:09 +0200

This was a PRO answer, thanks


Enviado con

El viernes 20 de abril de 2012 a las 16:45, Christopher Stone escribió:

set myList to "SMB NORTHBRIDGE CHIP DIE: 51 C
SMC BATTERY: 35 C
SMART Disk Hitachi HTS545050B9SA02 (100826PBL40017J9VZTV): 32 C
SMC BATTERY POSITION 2: 35 C
"

# Grep
set foundLine to do shell script "egrep -i 'disk' <<< " & quoted form ofmyList

# Sed
set foundLine to do shell script "sed -n '/[dD]isk/p' <<< " & quoted form ofmyList

# Awk
set foundLine to do shell script "awk '/[dD]isk/' <<< " & quoted form ofmyList

# Perl
set foundLine to do shell script "perl -wlne 'if (m/(?ims)(^.+disk.+)/) {print \"$1\"}' <<< " & quoted form of myList

# Satimage.osax
set foundLine to find text ".+disk.+" in myList with regexp and string resultwithout case sensitive

# ASObjC Runner
tell application "ASObjC Runner"
set foundLine to look for "^.+disk.+" in myList options "im"
if foundLine is not {} then set foundLine to item 1 of foundLine
end tell

 _______________________________________________
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: Find text
      • From: KOENIG Yvan <email@hidden>
References: 
 >Find text (From: Javi Pérez <email@hidden>)
 >Re: Find text (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Find text
  • Next by Date: Re: Find text
  • Previous by thread: Re: Find text
  • Next by thread: Re: Find text
  • Index(es):
    • Date
    • Thread