日期:2014-05-20  浏览次数:20716 次

如何将下面数据中的字母以及空行去掉,只保留数字?
NODE X Y Z
  1 0.00000000000 0.150000000000E-02 0.00000000000  
  2 0.00000000000 0.00000000000 0.00000000000  
  3 0.00000000000 0.148500000000E-02 0.00000000000  
  4 0.00000000000 0.147000000000E-02 0.00000000000  
  5 0.00000000000 0.145500000000E-02 0.00000000000  
  6 0.00000000000 0.144000000000E-02 0.00000000000  
  7 0.00000000000 0.142500000000E-02 0.00000000000  
  8 0.00000000000 0.141000000000E-02 0.00000000000  
  9 0.00000000000 0.139500000000E-02 0.00000000000  
  10 0.00000000000 0.138000000000E-02 0.00000000000  
  11 0.00000000000 0.136500000000E-02 0.00000000000  
  12 0.00000000000 0.135000000000E-02 0.00000000000  
  13 0.00000000000 0.133500000000E-02 0.00000000000  
  14 0.00000000000 0.132000000000E-02 0.00000000000  
  15 0.00000000000 0.130500000000E-02 0.00000000000  
  16 0.00000000000 0.129000000000E-02 0.00000000000  
  17 0.00000000000 0.127500000000E-02 0.00000000000  
  18 0.00000000000 0.126000000000E-02 0.00000000000  
  19 0.00000000000 0.124500000000E-02 0.00000000000  
  20 0.00000000000 0.123000000000E-02 0.00000000000  

  NODE X Y Z
  21 0.00000000000 0.121500000000E-02 0.00000000000  
  22 0.00000000000 0.120000000000E-02 0.00000000000  
  23 0.00000000000 0.118500000000E-02 0.00000000000  
  24 0.00000000000 0.117000000000E-02 0.00000000000  
  25 0.00000000000 0.115500000000E-02 0.00000000000  
  26 0.00000000000 0.114000000000E-02 0.00000000000  
  27 0.00000000000 0.112500000000E-02 0.00000000000  
  28 0.00000000000 0.111000000000E-02 0.00000000000  
  29 0.00000000000 0.109500000000E-02 0.00000000000  
  30 0.00000000000 0.108000000000E-02 0.00000000000  
  31 0.00000000000 0.106500000000E-02 0.00000000000  
  32 0.00000000000 0.105000000000E-02 0.00000000000  
  33 0.00000000000 0.103500000000E-02 0.00000000000  
  34 0.00000000000 0.102000000000E-02 0.00000000000  
  35 0.00000000000 0.100500000000E-02 0.00000000000  
  36 0.00000000000 0.990000000000E-03 0.00000000000  
  37 0.00000000000 0.975000000000E-03 0.00000000000  
  38 0.00000000000 0.960000000000E-03 0.00000000000  
  39 0.00000000000 0.945000000000E-03 0.00000000000  
  40 0.00000000000 0.930000000000E-03 0.00000000000

------解决方案--------------------
public static void main(String[] args) {
String string = "0.1230000 00000E-02";
string = string.replaceAll("([^0-9.\\t\\n\\x0B\\f\\r])", "");
System.out.println("输出:0.12300000000002========="+string);
}
------解决方案--------------------