Writing flat file

Hi Team

For my current use case, I need to write a flat-file.

image

I am using the following pipeline to write csv.

Input to JSON formatter is a document of arrays each having different no of properties.

Can you please suggest a way to generate CSV file ignoring all null values and writing only what is present?
Note - Each input document to CSV formatter has different set of properties.
Thanks in advance

@ayush.vipul, see if the attached pipeline will assist you as an example. I have simple, arbitrary data in the JSON Generator, but the Mapper and Fixed Width Formatter is the key. The Field Width value in the Formatter is also arbitrary, but needs to be set large enough to handle the longest expected line widths.

Community.5728_2019_07_19.slp (5.8 KB)

@del Thanks.

This helps us achieve what we we looking for.

Best Regards
Ayush