能够解析类似下面的文本a,b,"a,2","123""456",,"AAA
BBB",1000
100,200,"3,000",400,500,600结果为
[1,1] = a
[1,2] = b
[1,3] = a,2
[1,4] = 123"456
[1,5] = AAA
BBB
[1,6] = 1000
[2,1] = 100
[2,2] = 200
[2,3] = 3,000
[2,4] = 400
[2,5] = 500
[2,6] = 600

解决方案 »

  1.   

    456",,"AAA 
    two ","?The following is the Pseudocode:// [linCounts, elementCounts]
    int lineCounts = 0;    
    int elementCounts = 0;BufferedReader bufferedReader = new BufferedReader (new FileReader(filePath));String lineString = "";linString = file's everyline
    lineCounts ++;String[] element = linString.split(",")
    elementCounts = element.length;
    ...
      

  2.   

    456",,"AAA 中间是一个空字段用split不能实现要求
      

  3.   

    Well...I don't know, cause I can't find the regularity...
      

  4.   

    可以先replaceAll下,把空字段去掉
      

  5.   

    According to what I said in 3#:if (linString.contains(",,"))
       linString.replaceAll(",,", ",");
      

  6.   

    重复帖,见:http://topic.csdn.net/u/20080529/18/6c4e70e9-4510-4af0-8874-207c5a9a1788.html