public static ArrayList getTargetDataFromCsv(String targetForAddPath)
{
TableMgr tableMgr = TableMgr.getInstance();
StringLineCompare comparator = TargetTable.getInstance().getStringLineCompare();
ArrayList RowList = new ArrayList(5000000);
CsvReader reader = null;
try
{
reader = new CsvReader(targetForAddPath, ',', Charset.forName(tableMgr.getCharset()));
reader.readRecord();
//是Copyright则代表下面还有一行表头
if(-1 != reader.getRawRecord().toLowerCase().indexOf("Copyright".toLowerCase()))
{
reader.readRecord();
}
while (reader.readRecord())
{
RowList.add(reader.getValues());
}
System.out.println("over");
}
catch (FileNotFoundException e1)
{
e1.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
reader.close(); //这个以后完全没有释放出内存
}
return RowList;
}
2010年7月09日 12:19