Skip to main content
Solved

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

  • September 27, 2016
  • 5 replies
  • 38 views

Forum|alt.badge.img

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?

Best answer by ebygomm

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.

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

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • September 27, 2016

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.


mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • September 27, 2016

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.


Forum|alt.badge.img
  • Author
  • September 27, 2016

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


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • September 27, 2016

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!