像這樣的excel格式,我導入excel時,怎麼去解析這個文件?<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+yOe5+8D708PV/bOjtcS3vcq9yKW2wcihtaXUqiYjMjY2ODQ7o6zWu8TctsHIobrPsqLQ0NbQtcS12tK70NC1xMr9vt2jrMbky/vQ0M6qv9WhozwvcD4KPHA+y/nS1LHY0OvSqtaqtcC6z7Ki0NDKx7TTxMTQ0L+qyryjrMTE0NC94cr4o6zV4tCp0NC1xCYjMjA1NDA7trzIpbbByKHV4rj2us+yotDQ1tC1xLXa0rvQ0Mr9vt2hozwvcD4KPHA+ssnIobXEt73Kvcjnz8KjujwvcD4KPHA+PC9wPgo8cHJlIGNsYXNzPQ=="brush:java;">/**
* 合並單元格處理,獲取合並行
* @param sheet
* @return List
*/
public List getCombineCell(Sheet sheet)
{
List list = new ArrayList();
//獲得一個 sheet 中合並單元格的數量
int sheetmergerCount = sheet.getNumMergedRegions();
//遍歷合並單元格
for(int i = 0; i listCombineCell,Cell cell,Sheet sheet) throws Exception
{
int firstC = 0;
int lastC = 0;
int firstR = 0;
int lastR = 0;
String cellValue = null;
for(CellRangeAddress ca:listCombineCell)
{
//獲得合並單元格的起始行, 結束行, 起始列, 結束列
firstC = ca.getFirstColumn();
lastC = ca.getLastColumn();
firstR = ca.getFirstRow();
lastR = ca.getLastRow();
if(cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR)
{
if(cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC)
{
Row fRow = sheet.getRow(firstR);
Cell fCell = fRow.getCell(firstC);
cellValue = getCellValue(fCell);
break;
}
}
else
{
cellValue = "";
}
}
return cellValue;
}