If it's all newline-delimited, I'd use something like:

Text: read/lines %WhateverTheFilesWas
NewList: []

foreach Val Text [
   if not find NewList Val [insert tail NewList join Val newline]
]
write %TheNewFileName rejoin NewList


So that would create a new file with all the values, none being repeated.
(Also, instead of using "insert tail", you can use "append" - but "isnert
tail"
is slightly faster)

(For anyone else: ) Did I miss anything?  Can it be optimized more?

             -Izzy Boy


----- Original Message -----
From: "Kai Peters" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 02, 2005 5:53 PM
Subject: [REBOL] Another newbie problem


>
>
> Hi all ~
>
> given a simple text file containing values like this, how can I can create
a=
>  second file containing every value only once.
> Speed does matter as I have to handle millions of entries.
>
> Thanks for any pointers,
> Kai
>
>
> G10T0O6030
> G10T0O6030
> 1DY00Y6106
> 1DY00Y6106
> 2KN0I39987
> R1Q40K8008
> R1Q40K8008
> 2B1G6Y3626
> 2B1G6Y3626
> R1H0V06485
> 1XF00W6582
> M1F8N72518
> M1F8N72518
> P1Y41G0352
> Q1B0X06440
>
>
> --
> To unsubscribe from the list, just send an email to rebol-request
> at rebol.com with unsubscribe as the subject.
>


-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to