• 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: How can I perform following task
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I perform following task


  • Subject: Re: How can I perform following task
  • From: LuKreme <email@hidden>
  • Date: Thu, 16 Dec 2010 04:46:46 -0700

On 16-Dec-2010, at 04:35, Bert Groeneveld wrote:

> Hope someone can help with a smart piece of code that executes fast (I hope in just a few seconds).

Fastest way is going to be to grep the file with a do shell script. Something like this:

set myBarCode to "8717545743119"
set myFile to "/path/to/the/file"
set myArtNum to do shell script "grep " & myBarCode & " " & myFile | awk '{print $1}'"

(Untested, but something very much like that is going to be fast. Of course, if you need the 3rd field you'd replace $1 with $3.)

--
*** Word_of_God was kicked from #christian by SageRider (Please don't
Swear)

 _______________________________________________
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: How can I perform following task
      • From: Bert Groeneveld <email@hidden>
References: 
 >How can I perform following task (From: Bert Groeneveld <email@hidden>)

  • Prev by Date: How can I perform following task
  • Next by Date: Re:How to keep PhotoShop CS4 Save for Web plug-in from truncatingfilenames to 32 chars
  • Previous by thread: How can I perform following task
  • Next by thread: Re: How can I perform following task
  • Index(es):
    • Date
    • Thread