Skip to main content

There are, say, 600 records (this number is variable) in an Excel document. I would like to concatenate an attribute value with a URL, 4 records at a time (e.g. [first portion of URL]1,2,3,4[second portion of URL]). Is there a way to accomplish this?

If you divide your records into sets of 4, you can then use an aggregator grouping by set to concatenate the values, and then join this value to your URL values

e.g.


Nice answer @egomm - the other way I do this is to use a ModuloCounter (count to a max of 4), then a normal Counter, then calculate count-modulo and use the result of that as a group by.

Now that I think about it, yet another way to do this - without counting - is to the Prior/Next Record function.

ie concatenate record, record[+1], record [+2], record [+3] then use a Sampler to keep only every 4th record.


I agree with all the answers. I was going to suggest a ListBuilder then a ListConcatenator, but the aggregator does it all in 1 transformer indeed.


All excellent answers. I appreciate the assistance. =^)


Nice answer @egomm - the other way I do this is to use a ModuloCounter (count to a max of 4), then a normal Counter, then calculate count-modulo and use the result of that as a group by.

Now that I think about it, yet another way to do this - without counting - is to the Prior/Next Record function.

ie concatenate record, record[+1], record [+2], record [+3] then use a Sampler to keep only every 4th record.

 

I have to lookup the syntax for the prior/next record function every time so only resort to that when absolutely necessary!

Reply