| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| 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 |
|
#4
| |||
| |||
| Thanks! That worked for me. |
|
#5
| |||
| |||
| 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) |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.