terry
Freshman Member
Posts: 15
|
Post by terry on Oct 2, 2014 10:01:02 GMT -5
My first macro effort. Sometimes, one might want to know what the value of duplicate lines might be in a file rather than simply using DELETE DUP of SORT UNIQ to eliminate them. In a large file, this can be difficult and tedious. This macro will step through a pre-sorted file and create a file EXTDUPS.TXT containing the duplicate lines. Unlike DELETE DUP, a start column and end column can be used as arguments to limit the compare to specific columns in each line. Any suggestions for improvement would be appreciated. I toyed with the idea of copying the output buffer to the clipboard followed by issuing SPF_CMD("CLIP") in the hope that it would open a new tab containing the duplicate lines, but it doesn't seem to work. Cheers, Terry UPDATE: 10/03/2014 Added numeric verification of the column arguments. Duplicates are also saved to the Windows clipboard. Issue CLIP command to view them after macro completes. UPDATE: 10/04/2014 Added 3rd optional argument which allows user to specify whether to store duplicates in a file or Windows clipboard (Default). Added additional documentation. ExtDups.macro (6.89 KB)
|
|
terry
Freshman Member
Posts: 15
|
Post by terry on Oct 2, 2014 11:18:51 GMT -5
Thanks for the info Robert.
I wonder if you know how one might determine if any arguments passed to a macro are numeric? I can't seem to find a statement that might perform an "IF NUMERIC" type operation.
Regards, Terry
|
|
terry
Freshman Member
Posts: 15
|
Post by terry on Oct 3, 2014 6:25:38 GMT -5
Thanks again Robert.
|
|
|
Post by George on Oct 5, 2014 4:28:50 GMT -5
Terry: Robert: Welcome Terry, especially so since you're actually using the macro support. Too few users seem willing to explore it.
George (currently in Constanta Romania)
Sent from my Nexus 7 using proboards
|
|
terry
Freshman Member
Posts: 15
|
Post by terry on Oct 6, 2014 8:07:21 GMT -5
I guess part of the problem is thinking of something useful to do with the macro support. You've included so much native capability. 
|
|