Skip to main content
Solved

How to let the BulkAttributeRenamer do substring?

  • March 26, 2018
  • 5 replies
  • 31 views

nielsgerrits
VIP
Forum|alt.badge.img+60

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:

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

takashi
Celebrity
  • 7843 replies
  • March 26, 2018

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

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

0684Q00000ArJLtQAN.png


david_r
Celebrity
  • 8394 replies
  • 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
  • 8394 replies
  • March 26, 2018

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+60
  • Author
  • 2940 replies
  • March 26, 2018

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+60
  • Author
  • 2940 replies
  • March 26, 2018

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

Thanks for the effort!