choetl

JSON to CSV conversion using CHOETL displaying values in one row and not columns

帅比萌擦擦* 提交于 2021-02-08 11:19:32
问题 I am converting a JSON file to a CSV file. The JSON has multiple nested objects. While converting, I am able to get all the values out of the JSON and into the CSV. However, all the values are being shown as one row with the same heading repeated multiple times. I am using CHOETL library. using (var csv = new ChoCSVWriter("file1.csv").WithFirstLineHeader().WithDelimiter(",")) { using (var json = new ChoJSONReader("file2.json") .WithField("RecordID", jsonPath: "$..Events[*].RecordId")

Convert dynamic csv to json containing List<string> C#

ⅰ亾dé卋堺 提交于 2020-05-15 09:26:09
问题 I want to serialize a list of strings in C#? I have previously successfully used an open-source library Cinchoo ETL for similar tasks, but I am stuck in this particular scenario. I do not want to use POCO since my source data structure is dynamic. I would much rather read the data from a csv and serialize it. My source data in csv format: id,name,friends/0,friends/1 1,Tom,Dick,Harry Required output JSON - {"id":1,"name":"Tom","friends":["Dick","Harry"]} 回答1: Here you go, you can do with