Skip to main content
Solved

How to let the BulkAttributeRenamer do substring?


nielsgerrits
VIP
Forum|alt.badge.img+54

Is it possible to do a substring(0,10) with the BulkAttributeRenamer? I want to simulate truncating the columns as writing to shape does. I know I can do this with a SchemaMapper, this is my current workaround.

Best answer by david_r

You can use the regex replacement method. For example, this will truncate all attribute names to the first 10 characters:

View original
Did this help you find an answer to your question?

5 replies

takashi
Influencer
  • March 26, 2018

Hi @nielsgerrits, yes it's possible. Try this.

Text To Find: ^(.{10}).*
String: \1

0684Q00000ArJLtQAN.png


david_r
Celebrity
  • Best Answer
  • March 26, 2018

You can use the regex replacement method. For example, this will truncate all attribute names to the first 10 characters:


david_r
Celebrity
  • March 26, 2018
takashi wrote:

Hi @nielsgerrits, yes it's possible. Try this.

Text To Find: ^(.{10}).*
String: \1

0684Q00000ArJLtQAN.png

You beat me to it! :-)

nielsgerrits
VIP
Forum|alt.badge.img+54
takashi wrote:

Hi @nielsgerrits, yes it's possible. Try this.

Text To Find: ^(.{10}).*
String: \1

0684Q00000ArJLtQAN.png

Thanks! I knew it should be doable but gave up after a few tries.

 


nielsgerrits
VIP
Forum|alt.badge.img+54
david_r wrote:

You can use the regex replacement method. For example, this will truncate all attribute names to the first 10 characters:

Thanks for the effort!

 


Reply


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