Ok I think I understand now...

Generally NiFi is geared more towards operating on a single piece of data
at a time (one FlowFile), so taking one DSV and converting it to JSON is
straight forward, but trying to use several DSVs as input to produce one
JSON is more tricky.

What you might be able to do is first convert each DSV to JSON so in your
example you would first produce:

{ a = "valueA" }

{ b = "valueB" }

Then use MergeContent to merge all these JSON documents together, and then
possibly do more extracting/replacing after that turn it into your desired
output.

Maybe someone else has another idea of how to handle this.

-Bryan




On Wed, May 4, 2016 at 7:25 AM, idioma <[email protected]> wrote:

> Hi Bryan,
> thank you so much, I am glad I am on the right track. Regarding how the
> resulting json file is created, I should clarify that there are 5 different
> .dsv files from which the json will be created. Therefore, there are a
> number of denormalisation rules employed to produce what will be the
> output.
> For example, the following json is an example of a subset of the mappings:
>
> {
> a = "valueA",
> b = "valueB
>
> }
>
> From .dsv(s): DSV1, DSV2, DSV3, DSV4 and DSV5.
>
> The key/value "a" is from DSV1 where there is a column called "HeadingA"
> with value "a", however the value "valueA" is the actual description of "a"
> as per DSV4 (here is its structure):
>
> HeadingCode ¦ HeadingText
> a                   "valueA"
>
> There are other cases, like b where the value is taken straight from one
> .dsv file/column
>
> Does it clarify a bit? What is your recommendation in my scenario?
>
> Thank you so much.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-nifi-developer-list.39713.n7.nabble.com/Using-the-template-cvs-to-json-to-convert-dsv-files-into-json-format-a-few-questions-tp9738p9899.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>

Reply via email to