Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ParseLog {
- public void AsteroidParse() throws IOException {
- List<String> list = new ArrayList<String>();
- FileReader input = new FileReader("D:\\Eclipse Projects\\TestSTufufufuf\\src\\res\\SpaceEngineersDedicated.log");
- BufferedReader bufRead = new BufferedReader(input);
- //Asteroids ast = new Asteroids();
- String myLine = null;
- String[] asteroidName = null;
- String[] asteroidLocation = null;
- String[] asteroidLocationFixed = null;
- String userName = null;
- String userId = null;
- String userNameFixed = null;
- String userIdFixed = null;
- String userLeft = null;
- String userLeftAlt = null;
- while ((myLine = bufRead.readLine()) != null) {
- if (myLine.contains("File:")) {
- asteroidName = myLine.split(":");
- //System.out.println(asteroidName.length);
- System.out.println(asteroidName[4]);
- //userName = userNameArr[2];
- //list.add(userName);
- }
- if (myLine.contains("Size:")) {
- asteroidLocation = myLine.split("\\[");
- //System.out.println(asteroidLocation.length);
- if(asteroidLocation.length >= 2) {
- asteroidLocationFixed = asteroidLocation[1].split(",");
- //System.out.println(Arrays.toString(asteroidLocationFixed));
- System.out.println(asteroidLocationFixed[0]);
- System.out.println(asteroidLocationFixed[1]);
- System.out.println(asteroidLocationFixed[2]);
- }
- //userName = userNameArr[2];
- //list.add(userName);
- }
- }
- //System.out.println(list);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement