You are using the wrong tool to solve your problem.

If you dont want to install MySQL, most any other DB will do (even Access probably). If the other DB doesn't allow uniqueness constraints on fields then just SELECT DISTINCT instead.

This might seem like alot of work, but if properly set up, you can use it over and over to process this file whenever you need to. Or you could just start using the DB instead anyway since it will make your life a lot easier anyway.

-stvn

Update: The more i re-read your post the more confused I am getting. Are these already in a database (RDMS)? Or is it in a text-file-database? If its already in a RDMS then just do a SELECT DISTINCT <column name> FROM <tablename> to get what you want, otherwise, see above. If you can't install the DB on the server, do it on your local machine and download the file. And for sure,.. don't do something like this with a CGI script, it will surely timeout no matter what you do.


In reply to Re: Removing duplicates in large files by stvn
in thread Removing duplicates in large files by TIURIC

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.