With the view of ultimately sharing a template for converting dsv into json
(this is the least I can do with all the help received from this amazing
community), I have been working my way trough the steps for the dataflow and
still running into some troubles and not sure why. Here is my ExtractText ->
ReplaceText strategy:
I have replaced my initial delimiter symbol eventually with a semi-column,
so my ExtractText looks like this (I have added the attribute dsv:
dsv = (.+);(.+);(.+);(.+)
This should parse the content and pipe it in the dataflow. Then, the
ReplaceText will do the following:
Search Value = (?s:^.*$)
ReplacementValue =
{
"testField" : "${dsv.1}"
}
My sample data looks like something like this (full version is around 30
delimited values):
"HeadingA";"HeadingB";"HeadingC";"HeadingD";"HeadingE"
4787; "788769"; "67869"; "SomeText"; 12-07-200 13.45.22
The initial value is not enclosed within "" and some values such as date,
datetime and some numerical ones too are randomly not wrapped up with the
speech marks.
My final Json output looks rather weird and I am not sure why this is
happening (is this because my search value is the default one? Can I search
for ${dsv} ?
{
"testField" : "4787; "788769"; "67869"; "SomeText"; 12-07-200 13.45.22"
}
I am expecting to have the testField matched to 4787, is that correct. I
though the issue was the lack of speech marks and I have tweaked the data
sample to look like the other fields, but no joy.
Can you help?
--
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-tp9738p9965.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.