Java scanner - taking specific part of line

Posted by user1290213 on Stack Overflow See other posts from Stack Overflow or by user1290213
Published on 2012-03-24T16:48:33Z Indexed on 2012/03/24 17:29 UTC
Read the original article Hit count: 124

Filed under:

Hi ive got a log file containing trace routes and pings. Ive seperated these by using if(scanner.nextLine().startsWith("64 bytes"){}

so i can work with just the pings for now.

All im interested in from the ping is time=XX

example data line =

64 bytes from ziva.zarnet.ac.zw (209.88.89.132): icmp_seq=119 ttl=46 time=199 ms

I have been reading other peoples similar questions and im not sure how to apply to mine.

I literally need just the number as i will be putting them into a csv file so i can make a graph of the data.

© Stack Overflow or respective owner

Related posts about java