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)
below is the java 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 } this should be the output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started