展开全部

思路:按照字节读取文件到缓冲,然后对文件内容进行处理。

代码如下:62616964757a686964616fe78988e69d8331333335306334

public static void readFile() throws IOException{
RandomAccessFile f = new RandomAccessFile("test.txt", "r");
byte[] b = new byte[(int)f.length()];
//将文件按照字节方式读入到字节缓存中
f.read(b);
//将字节转换为utf-8 格式的字符串
String input = new String(b, "utf-8");
//可以匹配到所有的数字
Pattern pattern = Pattern.compile("\\d+(\\.\\d+)?");
Matcher match = pattern.matcher(input);
while(match.find()) {
//match.group(0)即为你想获取的数据
System.out.println(match.group(0));
}
f.close();
}