Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

deleting dupilcates from a MSWord list of addresses

Jul 7, 2005 10:08PM PDT

I have a .txt file list of customer addresses generated from a secondary program (about 6000 addresses). There are a good many duplicates (several hundred plus).

I'd like a macro (VBA...) or a program that will delete the duplicates.

I've done this before, a while back, it seems somebody had a site that I ran their program (VBA) from and it did it for me, but I can't remember where or how I got there.

BIG NOTE: some addresses have 3 lines some have 4 lines, that's just one of my big hangups.

TIA
Phil

Discussion is locked

- Collapse -
have you thought of using excel.
Jul 9, 2005 10:49PM PDT

Have you thought to use excel insteat of word to do this, there is an earlier thread that describes how to get unique records in excel. you can open the document in excel, highlight the column that the data opened in, and on the toolbar choose Data, then text to columns. This will give you everal options to seperate your data into columns. you then add headers (if they are not already in your sheet) and add filters to the headers. that might work

- Collapse -
tried excel
Jul 10, 2005 9:43PM PDT

Yes, but the data is all in one column, not by row where I can sort by name... If I do it now all my Street data and City data will be sorted as if they were Name data...

Unless you've got a different view than mine...

Thanks anyway

- Collapse -
excel
Jul 12, 2005 1:34AM PDT

use the text to column feature that will allow you to put the data in different columns.

- Collapse -
excel text to columns
Jul 12, 2005 2:48AM PDT

The Text-To-Columns feature in Excel only allows you to split multiple data elements contained *in a single row* into their own separate columns.

Looking carefully back at Phil's original question, he mentions "... some addresses have 3 lines some have 4 lines ..." which would indicate that the 'data elements' (name and address fields) in this case are already separated over several rows, rather than all being on a single row.

That being the case, the Text-To-Columns feature of Excel would not be applicable.

- Collapse -
Text file layout?
Jul 11, 2005 2:37AM PDT

Hi Phil,

Is there any consistent structure to the text file?

For example, is there anything that separates every customer address record? For example, there might be one blank line in between each (but if so, do any of the addresses have blank lines in part of the address which spoils the consistency) ?

Which program generated the addresses? Is it a well-known commercial application?