Question: The whole point of this code was to read json files through different directories in which they were inside a folder called parm and populate

The whole point of this code was to read json files through different directories in which they were inside a folder called "parm" and populate them in a csv file. Can you write a code to make it more efficent(shorter lines of code)

import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FilenameFilter; import java.io.PrintWriter; import java.util.Arrays; import com.google.gson.JsonArray; import com.google.gson.JsonParser;

public class start {

public static void main(String[] args) throws FileNotFoundException { // C:\\Users\\AG05359\\Desktop\\bdf-rscz-etl\\streamsets // System.out.println(Arrays.toString(directories)); String initDirectory = "C:\\Users\\AG05359\\Desktop\\bdf-rscz-etl\\streamsets"; String [] directories = returnDirectories(initDirectory); System.out.println(Arrays.toString(directories));

//17-19 PrintWriter pw = new PrintWriter(new File("parm.csv")); StringBuilder sb = new StringBuilder(); sb.append("Subject Name"); sb.append(','); sb.append("Template Name"); sb.append(','); sb.append("File Name"); sb.append(','); sb.append("Property Name"); sb.append(','); sb.append("Property Value"); sb.append(' '); for(int i =0;i

}

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!