Solved

How to Read 4 Records at a time from an Excel Document

  • 27 September 2016
  • 5 replies
  • 2 views

Badge

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?

icon

Best answer by ebygomm 27 September 2016, 16:47

View original

5 replies

Userlevel 1
Badge +21

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.

Userlevel 4
Badge +25

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.

Badge

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

Userlevel 1
Badge +21

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