Skip to main content
Question

How to replace text in dwg with help of xls spreadsheet


proteve
Contributor
Forum|alt.badge.img+2

How can I replace different texts in a dwg file with the help of pairs of search/replace data from 2 columns in an xls table?

9 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

You can use a DatabaseJoiner, FeatureMerger or FeatureJoiner to join the Excel data to your DWG and then replace the acad_text_string attribute with the value from Excel.


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 13, 2023
redgeographics wrote:

You can use a DatabaseJoiner, FeatureMerger or FeatureJoiner to join the Excel data to your DWG and then replace the acad_text_string attribute with the value from Excel.

if i understand correctly all these suggestions assumes i have an attribute to join them. i have only a table with 1st column for text to search and 2nd column with the replace value.


redgeographics
Celebrity
Forum|alt.badge.img+49
proteve wrote:

if i understand correctly all these suggestions assumes i have an attribute to join them. i have only a table with 1st column for text to search and 2nd column with the replace value.

Correct, your DWG texts will have a (potentially hidden) acad_text_string attribute containing the text, you can join on that.


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 13, 2023
proteve wrote:

if i understand correctly all these suggestions assumes i have an attribute to join them. i have only a table with 1st column for text to search and 2nd column with the replace value.

thats true but that is not the same as the 1st column. 1st column of the table might contain the entire text or parts of the text i need to replace


redgeographics
Celebrity
Forum|alt.badge.img+49
proteve wrote:

if i understand correctly all these suggestions assumes i have an attribute to join them. i have only a table with 1st column for text to search and 2nd column with the replace value.

Aha, that changes things. Can you post a sample?


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 13, 2023
proteve wrote:

if i understand correctly all these suggestions assumes i have an attribute to join them. i have only a table with 1st column for text to search and 2nd column with the replace value.

here, i've attached a simple example.

 


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 13, 2023
proteve wrote:

if i understand correctly all these suggestions assumes i have an attribute to join them. i have only a table with 1st column for text to search and 2nd column with the replace value.

another try for the xls


redgeographics
Celebrity
Forum|alt.badge.img+49
proteve wrote:

if i understand correctly all these suggestions assumes i have an attribute to join them. i have only a table with 1st column for text to search and 2nd column with the replace value.

I think you would first need to decide what you want to do with partial or fuzzy matches. If it's a simple 1-to-1 match you can use the method I described earlier but for anything else you'll need to work out those rules first.


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 13, 2023

thats the problem. i have parts of text to search and replace. thats why i can't match by attribute. so it's not 1 to 1. i have from 100 to 500 texts in dwg (not unique) and i need to replace them with the matching values from xls file.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings