我使用JAVA编写此代码以从URL获取数据,它可以工作,但我很困惑如何从while循环中获取结果中的第二个数据,
public static void main(String[] args) throws Exception {
// TODO code application logic here
URL link = new URL("http://192.168.1.5");
try (BufferedReader in = new BufferedReader(
new InputStreamReader(link.openStream()))) {
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
}
}
The Resuslt : Records:60 Counter:3,0:in,1:out,2:inside 2019/04/22 16:37:00,1797,1774,23 -------> I Just Want take This Result 2019/04/22 16:36:00,1797,1774,23 2019/04/22 16:35:00,1797,1774,23 2019/04/22 16:34:00,1797,1774,23 2019/04/22 16:33:00,1797,1774,23