Skip to main content
Question

Generate file footer


If I read from an api and generate a csv file, how can I add the number of records read as a footer in the csv file?

3 replies

Forum|alt.badge.img
  • StreamSets Employee
  • 31 replies
  • June 3, 2022

H @ana00159, Can you please elaborate your requirement?


  • Author
  • Discovered Fame
  • 11 replies
  • June 4, 2022

Something like I invoke a source api and I will get the count of the records that’s read and add it as part as a field at the end of the file. Basically recon information like source count and target count.


Bikram
Headliner
Forum|alt.badge.img+1
  • Headliner
  • 486 replies
  • June 28, 2022

@ana00159 

You can execute the loop using jython ,groovy or java script to count the number records read from source API .

Declare the count as global variable and store the count value  to a new variable.

Then create the file with the total number of records at the end of the file. .

 

 

 


Reply