AnsweredAssumed Answered

Calculation - prepend text to first iteration?

Question asked by JamesGrubic on May 22, 2012
Latest reply on May 22, 2012 by philmodjunk

Title

Calculation - prepend text to first iteration?

Post

I have a calculation with that creates a very custom formatted CSV. It's a bit of a kludge in that one calculation field combines all of the fields I need in a specific order, and inserts commas to match empty entries where I don't have equivalent fields in my database.

When I export, I just export this one field and it's already properly formatted with all of the data in the right order, etc.

It's working well, except I need to prepend some custom information to the first iteration only. That would be fine for me to just copy/paste into the header file, but I have about 20 other users wanting to do this and I'd like it all to be combined.

So let's say my export looks like this (2 records export):

"John","Doe","1313 Mockingbird Lane","Tuscaloosa","Alabama"

"Jane","Doe","1 Infinite Loop","Cupertino","California"

 

I need the very first line exported to contain some extra info, or a "header". 

Like this:

#
# Header: keys to import
#
First-name,Last-name,Address,City,State
# Records: values to import
#
"John","Doe","1313 Mockingbird Lane","Tuscaloosa","Alabama"
 

Is it possible to have adjust my calculation so that the very first iteration only contains those few extra lines of text?

 

(I know you may be thinking to just use a "Merge" type of export but the headers won't match at all, which is why I need to kludge the header as well as the formatting order of the data.)

 

 

Thanks for any advice

Outcomes