Question: Need help understanding how to do this. = Challenge Data Converter - CSV to JSON Programming challenge description: Read a tabular data set from input

 Need help understanding how to do this. = Challenge Data Converter- CSV to JSON Programming challenge description: Read a tabular data setfrom input and write it out in JSON. For example: Purchase Date,

Need help understanding how to do this.

= Challenge Data Converter - CSV to JSON Programming challenge description: Read a tabular data set from input and write it out in JSON. For example: Purchase Date, Item Name, Amount, Currency 2019-01-07, Pizza, 18.00, USD 2019-01-07,Ice Cream, 6.00 USD 2019-01-08, Dozen Eggs ,4.00 USD Input: A CSV-formatted series of records with one record on each line of input. The first line of input will have the column names for the data set. No escape characters or special handling for values containing commas or quotes will be used. Output: A standard JSON-formatted response in the RFC 7159 format with two spaces per indent. The first item will be the field headers from the CSV. Test 1 Test Input 6 Purchase Date, Item Name, Amount, Currency 2019-01-07, Pizza, 18.00, USD 2019-01-07, Ice Cream, 6.00, USD 2019-01-08, Dozen Eggs, 4.00, USD Expected Output [ [ "Purchase Date", "Item Name" "Amount", "Currency" ] [ "2019-01-07", "Pizza", "18.00", "USD" ], > Editor Java (v 1.14) Default Key Bindings C Reset Code 8 1 import java.io.BufferedReader; 2 import java.io.IOException; 3 import java.io.InputStreamReader; 4 import java.nio.charset StandardCharsets; 5 6 public class Main { 7 /** * Iterate through each line of input. 9 10 public static void main(String[] args) throws IOException { 11 InputStreamReader reader = new InputStreamReader (System.in, StandardCharsets.UTF_8); 12 BufferedReader in = new BufferedReader (reader); 13 String line; 14 while ((line in.readLine()) != null) { 15 System.out.println(line); 16 17

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!