Column Expression - Standardizing Addresses

Hello! Looking for help in using Column Expression Editor. I have two files with addresses and one file uses abbreviations for Street, Boulevard, Parkway, etc. I would like to use Column Expression Editor and use ‘replace’ expression to find the elongated text and replace with the abbreviations.

If I understand correctly, I can use Column Expression Editor to replace multiple elongated texts at a time vs. using ‘String Manipulation’. This is my first time using this node, so I am sure the syntax is probably incorrect. Please see the error message below:

Appreciate the help!

Welcome to the forum, @Election24.

The error message is pretty self-explanatory. You configured the node to output an integer, then supplied it with data that cannot be an integer. You need to correct this.

elsamuel - I double checked both files and the addresses are configured as strings.

File to be converted

elsamuel! Found it. Understand now. However, it did not replace Street with St.

Output Table:

image

elsamuel! Found it. Understand now. However, it did not replace Street with St.

You’re not really providing any troubleshooting information. This cropped screenshot doesn’t help.

In your initial screenshot you configured the node to output a new column named “New Address”. Why are you highlighting the “ADDRESS” column in the most recent screenshot?

How is the Column Expressions node configured?

When asking for help here, it’s a good practice to at least provide the data. The ideal case would be to share the workflow itself along with the data.

1 Like

So, I am new to this forum and am just learning Knime. I have built some very simple flows, and the expression editor is new to me. Apologize if I am not providing enough information to help me troubleshoot. I’m not even sure how to share all of that with you, however, I do see what you are saying and in the new column it is correcting the address.

I will work with it from here. Appreciate the help.

3 Likes

According your first screenshot, the changes are expected on new column new Address not the original one.

1 Like

@elsamuel especially with new people on the KNIME forum I think it would be best to ask questions and point to helpful resources about how to write a good forum question and how to share data (How to write a good post) or provide a logfile if necessary (Files Corrupted During File Transfer - #8 by mlauber71).

I know that as an experienced user it can be frustrating to see just screenshots (again) but sometimes it is not easy to decide if a problem can be solved by a quick question (that is screenshot) or it might need a more complex example (that is data and a sample workflow). In my experience often the process of providing such workflows and sample data might lead to some thoughts about the task (business problem) itself which often is at the heart of a seemingly ‘technical’ problem. As (if I might) elders :slight_smile: in this forum we could set ourselves the tasks of guidance and help to broaden the overall understanding of KNIME (more often than not including my own).

Thank you for all your valuable work and help you are providing for the KNIME community.

2 Likes

Thank you for the link on post writing. That is much appreciated.

1 Like

I just wanted to follow up with what my solve ended up being. I used the Column Expression node to corrected all of the elongated text in my single column by using this expression:

replace(replace(replace(replace(column(“ADDRESS”),“STREET”,“ST”),“NORTH”,“N”),“AVENUE”,“AVE”),“BOULEVARD”,“BLVD”)

There were actually 15 different replace variations in the expression. If there is a better way to achieve this, please let me know.

Thanks

2 Likes

Congrats that you fixed it. And thanks for sharing with the community

Alternavtively you could also use String Replace Dictionary
br

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.