Replies: 1 comment 2 replies
-
you can use this pattern to meet your needs. first construct ChoJSONRecordConfiguration with fields and then pass it to ChoJSONReader during parsing.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Great work of ChoETL, thank you and keep up the good work.
How about capability to configure which fields (child nodes) to extract from json data?
example:
would require me to hardcode the field names of AFieldInJSonData and BFieldInJSonData.
I would prefer to have a string of fields to extract and build the config before writing using the ChoCSVWriter.
I could use
using (var r = ChoJSONReader.LoadText(json)
.WithFields("FieldA", "FieldB","FieldC","FieldD","FieldE")
)
But perhaps there is abetter way of exporting all the elements with some kind of ProperFormatting for the columns-to-be in csv?
In the above example I am thinking a scenario of columns being named as "fielda,fieldb,fieldc,fieldd,fielde" but formatting them as above, will extract the correct columndata and have the column names match my code although the data in json file had no casing.
Before the "using (var r = ChoJSONReader.LoadText(json)" I could format/arrange/manage the json data as well.
It is really all about passing a string of "fieldA|FieldB" while more fields are in the json file that will be flattened
and extracted to csv file. Before the actual export to csv file, I could remove the unwanted elements matching a search string regex.
Any suggestion would be highly appreciated, thank you.
Best Regards BK
Beta Was this translation helpful? Give feedback.
All reactions