Re: Find duplicate numbers and replace
Re: Find duplicate numbers and replace
- Subject: Re: Find duplicate numbers and replace
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 14 May 2008 16:16:55 -0400
If you just add /g to your s//, it shouldn't matter what the line
endings are... The example file had all the matching numbers at the
beginning of a line, but that doesn't affect the logic of the solution
if you do a global search.
On 5/14/08, Skeeve <email@hidden> wrote:
> Mark J. Reed schrieb:
>> I'm curious, though: I don't see what cross-platform operation has to
>> do with the whole-file slurp. I agree that it's better not to do that
>> if you can avoid it, but that's just a general memory efficiency
>> issue. Where does portability come in?
>>
>>
> Count that to my not-so-well english. Your solution is fine in regards
> to the cross-platform problem I mentioned. Mine isn't.
>
> If you stay on one platform, meaning on the same platform the inputfile
> was created on, there won't be any problem.
>
> But as soon as the platforms are different the notion of \n is different
> and so reading in line by line won't work unless you set $/ to whatever
> the eol mark is on the platform the input file was created on.
>
> _______________________________________________
> 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
>
--
Sent from Gmail for mobile | mobile.google.com
Mark J. Reed <email@hidden>
_______________________________________________
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