• 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: strange behaviour in search for \n
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange behaviour in search for \n


  • Subject: Re: strange behaviour in search for \n
  • From: Simon Forster <email@hidden>
  • Date: Thu, 1 Jul 2004 11:40:40 +0100

On 1 Jul 2004, at 10:52, Charles Arthur wrote:

I've got a script that uses curl to download Amazon pages, and then extract
the sales rank by searching for the key phrase - Sales rank:
</b>\nXXXXX\n</font>

I imagine you're falling foul of the different line endings used within the Mac's different environments. And if \n is meant to match all styles of line ending, all I can say is that it's not worked that way for me! I have a routine written some time ago which replaces all the different styles of line endings with \r for just this reason.

Depending on your needs, you could probably just modify the line ending until you get what you want. I assume that curl doesn't modify line endings for http traffic so you'd need to use the appropriate line ending for the originating server:

property crlf : (ASCII character 13) & (ASCII character 10) -- Windows
property cr : (ASCII character 13) -- Mac
property lf : (ASCII character 10) -- Unix

HTH

Simon Forster
_____________________________________________________
LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247
_____________________________________________________
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: strange behaviour in search for \n
      • From: Charles Arthur <email@hidden>
References: 
 >strange behaviour in search for \n (From: Charles Arthur <email@hidden>)

  • Prev by Date: Re: Sum of list?
  • Next by Date: Re: strange behaviour in search for \n
  • Previous by thread: strange behaviour in search for \n
  • Next by thread: Re: strange behaviour in search for \n
  • Index(es):
    • Date
    • Thread