Re: strange behaviour in search for \n
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.