dimenticavo, nel frattempo ho modificato alcune cose. il nuovo codice è
codice:
import java.io.*;
class instanceCreator {
private BufferedReader inRdf, outRead;
private BufferedWriter outRdf;
instanceCreator (String inFile, String outFile){
try {
inRdf = new BufferedReader(new FileReader(inFile));
outRead = new BufferedReader(new FileReader(outFile));
outRdf = new BufferedWriter(new FileWriter(outFile));
} catch(IOException e) {e.printStackTrace();}
}
//Metodo complete
void complete() {
try{
String inputLine = inRdf.readLine();
int beginInd = 0;
int apartInd = inputLine.indexOf("@");
int vdoInd = apartInd+1;
String ns = inputLine.substring(beginInd, apartInd);
String vdo = inputLine.substring(vdoInd);
outRdf.write(ns);
CharSequence csq = vdo;
outRdf.append(csq);
String outputLine = outRead.readLine();
outputLine.replaceAll("%","\n");
inRdf.close();
outRead.close();
outRdf.close();
outRdf.flush();
} catch(IOException e) {e.printStackTrace();}
}
}
class testInstance {
public static void main(String[] args) throws IOException {
if(args.length != 2) {
System.out.println("Please enter <inFile>, <outFile>");
System.exit(1);
}
instanceCreator fileRDF = new instanceCreator(args[0],args[1]);
fileRDF.complete();
}
}