Solved

How to add Suffix value to specific attribute value?

  • 1 November 2021
  • 4 replies
  • 26 views

Hi All,

I am working a project ,where client asked us to add suffix to a attribute value .This attribute value is not a Unique , in order to make it unique we have ad suffix values as shown below image , requesting you all to provide a solution ? to reach this requirement! (the suffix number should be 4 numbers)

imageThanks in advance.

icon

Best answer by ebygomm 1 November 2021, 14:13

View original

4 replies

Userlevel 1
Badge +10

Use a counter, with a Counter Name/Group by set to the input Json document name, then an attributecreator/manager to add this attribute padded with zeroes to the document name

image

Userlevel 6
Badge +32

Multiple possibilities, this is how I do it:

  • Directory and File Pathnames Reader to scan for files
  • Excel Reader to read document with old and new names.
  • FeatureMerger to merge new names to files found.
  • AttributeCreater to create commandline command to rename file. (like this)
  • SystemCaller to run commandline.
Userlevel 4
Badge +35

I removed my answer (using a ListBuilder and a ListExploder), as @ebygomm​'s solution is faster and uses fewer transformers.

Use a counter, with a Counter Name/Group by set to the input Json document name, then an attributecreator/manager to add this attribute padded with zeroes to the document name

image

Thank you ebgomm, it worked as per my requirement.

image 

 

 

 

 

 

 

Reply