dimanche 29 mars 2015

save file into two different string

this is the file :


(define (problem gripper-4) (:domain gripper-strips) // store in string


(:objects rooma roomb left right ball1 ball2 ball3 ball4 )//should not save this


//store down in string


(:init (room rooma) (room roomb) (gripper left) (gripper right) (ball ball1) (ball ball2) (ball ball3) (ball ball4) (free left) (free right) (at ball1 rooma) (at ball2 rooma) (at ball3 rooma) (at ball4 rooma) (at-robby rooma) ) (:goal (and (at ball1 roomb) (at ball2 roomb) (at ball3 roomb) (at ball4 roomb) ) ) )


note : can use word "(:objects" in split this is my code store all file ):



import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class BufferedReaderExample {

public static void main(String[] args) {

BufferedReader br = null;

try {

String sCurrentLine;

br = new BufferedReader(new FileReader("C:\\testing.txt"));

while ((sCurrentLine = br.readLine()) != null) {
System.out.println(sCurrentLine);
}

} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null)br.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}

}
}

Aucun commentaire:

Enregistrer un commentaire