Pagini recente » Cod sursa (job #2071678) | Cod sursa (job #1730394) | Cod sursa (job #248123) | Cod sursa (job #2316597) | Cod sursa (job #1358414)
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package jsonconvertor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
*
* @author Andrei
*/
public class Main {
private final static String inputFilename = "convertor.in";
private final static String outputFilename = "convertor.out";
/**
*
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
Main main = new Main();
main.convert(inputFilename, outputFilename);
}
private void convert(String inputFilename, String outputFilename) throws FileNotFoundException {
Scanner in;
PrintWriter out;
String buffer;
String[] keys;
in = new Scanner(new FileInputStream(inputFilename));
in.useDelimiter("}");
out = new PrintWriter(outputFilename);
// Read keys
buffer = in.next();
keys = buffer.split(",");
for (String s : keys) {
out.print(s + ",");
}
in.close();
out.close();
}
}