Advertisement
mrkarp

parseLog

Oct 20th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 0 0
  1.  
  2. public class ParseLog {
  3.  
  4.     public void AsteroidParse() throws IOException {
  5.  
  6.         List<String> list = new ArrayList<String>();
  7.         FileReader input = new FileReader("D:\\Eclipse Projects\\TestSTufufufuf\\src\\res\\SpaceEngineersDedicated.log");
  8.         BufferedReader bufRead = new BufferedReader(input);
  9.         //Asteroids ast = new Asteroids();
  10.         String myLine = null;
  11.         String[] asteroidName = null;
  12.         String[] asteroidLocation = null;
  13.         String[] asteroidLocationFixed = null;
  14.  
  15.         String userName = null;
  16.         String userId = null;
  17.         String userNameFixed = null;
  18.         String userIdFixed = null;
  19.  
  20.         String userLeft = null;
  21.         String userLeftAlt = null;
  22.  
  23.         while ((myLine = bufRead.readLine()) != null) {
  24.             if (myLine.contains("File:")) {
  25.                 asteroidName = myLine.split(":");
  26.                 //System.out.println(asteroidName.length);
  27.                 System.out.println(asteroidName[4]);
  28.  
  29.  
  30.                 //userName = userNameArr[2];
  31.                 //list.add(userName);
  32.             }
  33.             if (myLine.contains("Size:")) {
  34.                 asteroidLocation = myLine.split("\\[");
  35.                 //System.out.println(asteroidLocation.length);
  36.                 if(asteroidLocation.length >= 2) {
  37.                     asteroidLocationFixed = asteroidLocation[1].split(",");
  38.                     //System.out.println(Arrays.toString(asteroidLocationFixed));
  39.                     System.out.println(asteroidLocationFixed[0]);
  40.                     System.out.println(asteroidLocationFixed[1]);
  41.                     System.out.println(asteroidLocationFixed[2]);
  42.                 }
  43.                 //userName = userNameArr[2];
  44.                 //list.add(userName);
  45.             }
  46.  
  47.         }
  48.         //System.out.println(list);
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement