Map15 CD1 CD2 CD3 CD4 CD5 CD6 Ass1 9 34 36 78738 9 10 12 22 0 9 22 25 0 ------------ Desired result: 9 10 12 22 25 34 36 78738Here is the algorithm, I started to write, but I can not finish:
******************************************************************** * Description.......: Update_Cheshire - removes duplicates and does other manipulations * Calling Samples...: * Parameter List....: * Created by........: Nadya Nosonovsky 08/30/2002 04:09:05 PM * Modified by.......: ******************************************************************** use cheshire in 0 alias Scan_File order map15 use cheshire in 0 alias Update_File again local lcMap, lcLoc, lnAss1, lcCd1, ; lcCd2, lcCd3, lcCd4, lcCd5, lcCd6, ; lnRecno, lcString, llAllow, lnElements, lnI local array laOriginal, laNew lcMap="" lcString = "" lcLoc = "" select Scan_File scan for Flag='D' if Ass1<> 0 lnRecno = recno() endif if Map15<>m.lcMap if m.llAllow goto m.lnRecno in Update_File replace CD1 with m.lcCD1, CD2 with m.lcCD2, CD3 with m.lcCD3, CD4 with m.lcCD4, CD5 with m.lcCD5, CD6 with m.lcCD6 delete for recno()<>m.lnRecno and Map15 = m.lcMap and Ass1=0 in Update_File endif lcMap = Map15 lcString = iif(not empty(cd1),cd1+chr(13),"") + ; iif(not empty(cd2),cd2+chr(13),"") + ; iif(not empty(cd3),cd3+chr(13),"") + ; iif(not empty(cd4),cd4+chr(13),"") + ; iif(not empty(cd5),cd5+chr(13),"") + ; iif(not empty(cd6),cd6,"") lcLoc = Loc else if m.lcLoc<>Loc && Address is different, don't do replacements llAllow = .f. else if not cd1 $ m.lcString or not cd2 $ m.lcString or not cd3 $ m.lcString or not cd4 $m.lcString lnElements = alines(laOriginal, m.lcString) =asort(laOriginal) dimension laNew[m.lnElements] for lnI=1 to m.lnElements if endifCould you please help?