How can i store a data from Excel sheet to an array.
Hi,
I want to Read an Open office excel file(.ods File) and need to fetch record row by row. Is there any method where i can use the data line by line and print it to the file that i have already created.
Code:
public static void ReadOds(File f1)
{
Writer output = null;
int i=1;
Sheet sheet;
try {
sheet = SpreadSheet.createFromFile(f1).getSheet(0);
int nColCount = sheet.getColumnCount();
int nRowCount = sheet.getRowCount();
System.out.println("Rows :"+nRowCount);
System.out.println("Cols :"+nColCount);
MutableCell cell = null;
for(int nRowIndex = 0; nRowIndex < nRowCount; nRowIndex++)
{
cell=sheet.getCellAt(i, nRowIndex);
System.out.print(cell.getValue()+ "");
}
I want to write the cell.getValue() into Files. Like first row into first File, 2nd Row into 2nd file and So on.....
please suggest me the way how can i make this simple and how to find the array size dynamically if my data is huge.
Thanks In Advance......