???????????????????????POI?????????csv?????β??????????csv???????Excel????????csv????????Excel????й漲?????????????????POI???????csv?????????????????£?????java????java csv????????????csv?????
????CSV??Comma Separated Values??????????????????д?????????????????????????????csv?????????????
??????
??????????
???????
???????
???????
????1997
????Ford
????E350
????ac?? abs?? moon
????3000.00
????1999
????Chevy
????Venture “Extended Edition”
?????
????4900.00
????1999
????Chevy
????Venture “Extended Edition?? Very Large”
?????
????5000.00
????1996
????Jeep
????Grand Cherokee
????MUST SELL!
????air?? moon roof?? loaded
????4799.00
??????????????????CSV?????????????У?
?????????????????????????
????1997??Ford??E350??”ac?? abs?? moon”??3000.00
????1999??Chevy??”Venture “”Extended Edition”“”??”“??4900.00
????1999??Chevy??”Venture “”Extended Edition?? Very Large”“”??”“??5000.00
????1996??Jeep??Grand Cherokee??”MUST SELL!air?? moon roof?? loaded”??4799.00
????java??β?????дcsv??????????opencsv??javacsv??????????????javacsv????csv?????
????import com.csvreader.CsvReader; 
????import java.nio.charset.Charset; 
????import java.util.ArrayList; 
????import java.util.List; 
????public class CsvUtil { 
????//???csv??? 
????public List<String[]> readCsv(String filePath) throws Exception { 
????List<String[]> csvList = new ArrayList<String[]>(); 
????if (isCsv(filePath)) { 
????CsvReader reader = new CsvReader(filePath?? '??'?? Charset.forName("GBK")); 
????reader.readHeaders(); // ???????   ?????????????????д??? 
????while (reader.readRecord()) { //???ж????????????? 
????csvList.add(reader.getValues()); 
????} 
????reader.close(); 
????} else { 
????System.out.println("?????????CSV?????"); 
????} 
????return csvList; 
????} 
????//?ж??????csv??? 
????private boolean isCsv(String fileName) { 
????return fileName.matches("^.+\.(?i)(csv)$"); 
????} 
????//???????? 
????public static void main(String[] args) throws Exception { 
????String filepath = "C:/???.csv"; 
????CsvUtil su = new CsvUtil(); 
????List<String[]> list = su.readCsv(filepath); 
????for (int r = 0; r < list.size(); r++) { 
????for (int c = 0; c < list.get(r).length; c++) { 
????String cell = list.get(r)[c]; 
????System.out.print(cell + " "); 
????} 
????System.out.print(" "); 
????} 
????} 
????} 
????д?????csv???
????/**  
????* д??CSV???  
????*/   
????public static void WriteCsv(){   
????try {   
????String csvFilePath = "C:/???.csv";   
????CsvWriter wr =new CsvWriter(csvFilePath??'??'??Charset.forName("SJIS"));//??????? 
????String[] contents = {"???????"??"???????"??"??????"??"???????"};                       
????wr.writeRecord(contents);   
????wr.close();   
????} catch (IOException e) {   
????e.printStackTrace();   
????}   
????}