Removing duplicate records

This is a discussion on Removing duplicate records within the REXX forums in Programming Languages category; Hi, I want to remove duplicate records from a pc file with regina rexx. What must I do? I need each record only once not two or more times. Regards, Xi...

Go Back   Application Development Forum > Programming Languages > REXX

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-06-2008, 12:06 PM
Xizor
Guest
 
Default Removing duplicate records

Hi,

I want to remove duplicate records from a pc file with regina rexx.
What must I do? I need each record only once not two or more times.

Regards,
Xi
Reply With Quote
  #2  
Old 08-06-2008, 03:37 PM
Richard Brady
Guest
 
Default Re: Removing duplicate records

Xizor wrote:
> Hi,
>
> I want to remove duplicate records from a pc file with regina rexx.
> What must I do? I need each record only once not two or more times.
>
> Regards,
> Xi

Tag each record; sort by the data portion of the record; compare each
data item with the previous item (except for the tag); place the data
items with tag in a new array; sort by the tag to restore the original
order; write the array without the tag;

That's what I've done.

Regards,
Richard
Reply With Quote
  #3  
Old 08-07-2008, 05:49 AM
Don Hills
Guest
 
Default Re: Removing duplicate records

In article <B3nmk.149041$102.51791@bgtnsc05-news.ops.worldnet.att.net>,
Richard Brady <rrllbrrady@worrlldnet.att.net> wrote:
>Tag each record; sort by the data portion of the record; compare each
>data item with the previous item (except for the tag); place the data
>items with tag in a new array; sort by the tag to restore the original
>order; write the array without the tag;


REXX makes it easy:

line. = ''
do while lines(infile) > 0;
in = linein(infile)
if line.in = '' then call lineout outfile, in
line.in = 1
end;

--
Don Hills (dmhills at attglobaldotnet) Wellington, New Zealand
"New interface closely resembles Presentation Manager,
preparing you for the wonders of OS/2!"
-- Advertisement on the box for Microsoft Windows 2.11 for 286
Reply With Quote
  #4  
Old 08-07-2008, 12:35 PM
Xizor
Guest
 
Default Re: Removing duplicate records

Thanks! That worked for me.
Reply With Quote
  #5  
Old 08-07-2008, 06:10 PM
Frank Clarke
Guest
 
Default Re: Removing duplicate records

On Wed, 6 Aug 2008 09:06:25 -0700 (PDT), Xizor <mn@mn-ix.de> wrote:
<ac80c5cf-b876-4482-ad68-cd852a0836e4@a1g2000hsb.googlegroups.com>

>Hi,
>
>I want to remove duplicate records from a pc file with regina rexx.
>What must I do? I need each record only once not two or more times.


status. = 0
do forever
/* read setting variable 'record' */
if status.record then iterate
queue record
status.record = 1
end

When you reach end-of-file, the queue will have only unduplicated records.


(change Arabic number to Roman numeral to email)
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:08 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.