John McKown wrote:
On Sun, 9 May 2004, John Doe wrote:


Hello all,
i trying to sort one my file that is 10 MB and contain
records:
---
aa
adsad
dasd
das
aa
---
i want to sort and eleminate double records.
I use:
$perl -0777ane '$, = "\n"; @[EMAIL PROTECTED] = (); print sort keys %uniq' \ out.log

But i recive error: Out of memory!
Yeah, this is normal, the file is 10 MB.

Any body can help me ?

Regards,
John



John,
What system? If you are on UNIX, I'd use the external "sort" command to sort my data, then use the "uniq" command. Much easier than using Perl, in my opinion.


sort <input.file | uniq >output.file

I can't help you if you are running under Windows. I don't think it has a "sort" or "uniq" command. If you need to process the records in Perl, I would most likely do:

sort <input.file | uniq | myPerlProgram.perl


-- Maranatha! John McKown


Thanks, this method is work great.

Regards,
John

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to