1) Replacing with GetFile sounds good

2) You are correct, there is nothing to set since you are getting it from
GetFile

3) You could probably replace all those characters with one ReplaceText
processor where the Search Value is something like (\n|\r|\t) and the
Replacement Value is empty.
I haven't tried this, but I think it should work.

4) That modified expression looks correct assuming ¦ is your delimiter.

5) Not totally sure I understand the question... In the example template,
field1 and field2 are just example field names to show how you could take
column 1 and column 2 from the CSV and put them into a JSON document.

Are you saying that you need to produce a single JSON document from
multiple dsv files? can you give a more concrete example of what the final
JSON needs to look like?

-Bryan


On Tue, May 3, 2016 at 11:23 AM, idioma <[email protected]> wrote:

> Hi Bryan, as always you are a star!
> Thank you so much for your help. It does start making much more sense now,
> I
> cannot thank you enough, this flow is really something challenging
> considering my current knowledge of NiFi. So, in my case:
>
> 1 ) I have replaced GenerateFlowFile with GetFile (which looks into a
> subset
> of the content from the .dsv files).
>
> 2) I believe I do not need to set any content (correct me if I am wrong)
> This step is, therefore, skipped.
>
> 3) There might be some need for removing special characters, \r \n and \t
> with " ", so I am thinking to use ReplaceText and then double check with
> ConvertCharacterSet so that ASCII has been converted into UTF-8. Can you
> have more than one replacement value? So, in the first case you would need
> to have a search value \r then your replacement value would be something
> like replaceAll("\r", " "), then I would need to do a similar thing with \n
> and \t.
>
> 4) Here my ExtractText would be slightly different from csv. Something
> like:
> (.+)¦(.+)¦(.+)¦(.+) with attribute dsv. Does it make sense?
>
> 5) ReplaceText, then, is a working in progress as I have a number of dsv
> files, which will then constitute the final json, so I will need to clarify
> the process in depth. I have a question, though. Are field1 as much as
> field2 and a new attribute matching to the desider Json field?
>
> Thank you again, I hope very soon to give back to the community! :)
>
>
>
> --
> 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-tp9738p9815.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>

Reply via email to