Skip to main content
Question

Trim white space from column names?

  • Oct 26, 2023 7:50 AM UTC
  • 3 replies
  • 213 views

aron
Enthusiast
Forum|alt.badge.img+16

I have some datasets with unpredictable white spaces in the attribute (column) names. Is there a way to automatically trim these? The trimming tools I found all seem to be dealing with strings.

3 replies

david_r
Celebrity
  • Oct 26, 2023 8:22 AM UTC

Did you look at the BulkAttributeRenamer? You can e.g. replace all spaces with nothing, or use a regex to constrain it further.


aron
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • Nov 2, 2023 1:15 PM UTC

I tried that but it went for the rows, I want to correct the attribute headings, the column names. Sorry that my explanation is a bit confusing.


aron
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • Nov 2, 2023 1:29 PM UTC

I just found somewhat of a workaround.

 

In the AttributeManager it is enough just to click each row in the Output Attribute column, if there is any white space the row is automatically set to rename, and the white space removed.