!* Machine: PDP-11/70 System: IAS V3.0 Author: John Guidi Date: 31-July-80 Residence: [?,?]NODUPS.TES Version: V1 Language: TECO V34 Useage: PDS> MUNG [?,?]NODUPS.TES, Effect: Duplicates of adjoining records in the specified file are removed. Text Registers: Qf = macro to open input,output files, and then yank first page in Qs = stored string Qt = refined text buffer sans duplications Numeric Registers: Qa = head of stored string Qb = working pointer of stored string Qc = tail of stored string Qd = head of test string Qe = working pointer of test string Qf = tail of test string Qm = ASCII value of character at Qb Qn = ASCII value of character at Qe Qs = ASCII value of first character in first page +1 *! !* 1. open the input and output files, then yank in first page *! j !* pointer to top of text buffer *! iEB !* attach EB command to file name *! zj !* move pointer to tail of file name *! @i/ y / !* add the yank command *! hxm !* place this macro in Qm *! hk !* clear the text buffer *! mm !* execute Qm. Files are opened, first page yanked *! !* 2. initialization of registers *! j !* pointer to top of text buffer *! 0aus !* ASCII code of first character in numeric Qs *! %s^us !* initialize text Qs to ASCII of first character +1 *! ^ut !* clear out text Qt *! !* 3. go through each record in the file, updating text Qs as needed, *! !* and removing all duplicate records. Each non-duplicate record *! !* is placed in text Qt *! !nextstring! j !* pointer to to top of text buffer *! .-z "E !* if EQ, we have finished with this page *! hk !* clear text buffer *! j !* pointer to top of text buffer *! gt !* retrieve updated text into text buffer *! ^n "N !* if NE, then we have examined everything *! p !* write out this buffer *! oend !* go exit *! ' p !* write out this buffer, read in next page *! ^ut !* initialize text Qt *! ' j !* pointer to beginning of text buffer *! .ua !* Qa = head of stored string *! gs !* fetch stored string into text buffer *! .uc !* Qc = tail of stored string *! .ud !* Qd = head of test string *! qd-z"E !* if EQ, then done with this page *! hk !* clear out text buffer *! onextstring !* go get next string *! ' l !* find terminating in test string *! 2r !* back up to tail of test string *! .uf !* Qf = tail of test string *! (qc-qa)-(qf-qd) "N !* string size unequal to last *! qd,qf:xt 13:^ut 10:^ut !* append this line to Qt *! qd,qfxs !* save string as last match *! qdj l qa,.d !* remove the top 2 lines *! onextstring !* go fetch next string *! | !* string size equal to last *! qaub qdue !* set pointers to beginning of strings *! !nextchar! qbj 0aum qej 0aun !* set Qm,Qn to ASCII code of pointers *! qm-qn "N !* pointed characters not equal *! qd,qf:xt 13:^ut 10:^ut !* append this line to Qt *! qd,qfxs !* save string as last match *! qdj l qa,.d !* remove the top 2 lines *! onextstring !* go fetch next string *! | %b %e qc-qb "E !* bump pointers. If EQ, then strings match *! qdj l qa,.d !* remove top 2 lines *! onextstring !* check next string *! | onextchar !* check next characters *! ' ' ' !end! ex