私のコードarp -aコンソール結果をJavaで表形式にスキャンするにはどうすればよいですか?
public static void main(String args[]){
try {
Process proc = Runtime.getRuntime().exec("arp -a ");
BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
// read the output from the command
String ps = null;
while ((ps = stdInput.readLine()) != null) {
System.out.println(ps);
// read any errors from the attempted command
while ((ps = stdError.readLine()) != null) {
System.err.println(ps);
}
}
}catch (IOException ex) {
System.err.println(ex);
}
}
私のコンソール出力は、私は、この出力は、それを行う方法を私に言うformat..pleaseテーブルに表示されなければならない必要
Interface: 192.168.201.1 --- 0x6
Internet Address Physical Address Type
192.168.201.2 48-88-ca-c8-87-4a static
192.168.201.4 00-6f-64-be-6e-e8 static
192.168.201.255 ff-ff-ff-ff-ff-ff static
224.0.0.2 01-00-5e-00-00-02 static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.251 01-00-5e-00-00-fb static
224.0.0.252 01-00-5e-00-00-fc static
224.0.0.253 01-00-5e-00-00-fd static
224.0.1.60 01-00-5e-00-01-3c static
239.192.152.143 01-00-5e-40-98-8f static
239.255.100.100 01-00-5e-7f-64-64 static
239.255.255.250 01-00-5e-7f-ff-fa static
239.255.255.253 01-00-5e-7f-ff-fd static
255.255.255.255 ff-ff-ff-ff-ff-ff static
です。 返信
markdownの使い方を学んでください。今回はあなたの書式を修正しました。あなたの要求については、_ "どうすればいいのか" _それはStackOverflowの仕組みではありません。私たちはあなたのためにあなたの仕事をしません。ここで話題になっていることを知るには、[ヘルプ]にアクセスして[ask]を読んでください。 –
大丈夫だから、 –