Forum Discussion
deepesh_jain
13 years agoFrequent Contributor
Hello Martin,
You can easiliy do this using open source jxl library files. Download jxl.jar which is available freely on net and do an import for following classes.
import jxl.*;
import jxl.write.*
You can then use excel objects easily, something like this:
def inFile = "C:\\inputFile";
def outFile = "C:\\outputFile";
Workbook inputFile = Workbook.getWorkbook(new File(inFile));
Workbook outputFile = Workbook.getWorkbook(new File(outFile));
// IF you are using the same file, you don't need to create 2 workbook objects.
Sheet inputWorkSheet = inputFile.getSheet("Sheet1");
Sheet outputWorkSheet = outputFile.getSheet("Sheet2");
You should be able to get a detailed api of jxl.jar online using which you can read and write cells in your excel. Here is the link for the documentation of classes and objects:
http://jexcelapi.sourceforge.net/resour ... index.html
Hope this helps.
Regards,
Deepesh Jain
You can easiliy do this using open source jxl library files. Download jxl.jar which is available freely on net and do an import for following classes.
import jxl.*;
import jxl.write.*
You can then use excel objects easily, something like this:
def inFile = "C:\\inputFile";
def outFile = "C:\\outputFile";
Workbook inputFile = Workbook.getWorkbook(new File(inFile));
Workbook outputFile = Workbook.getWorkbook(new File(outFile));
// IF you are using the same file, you don't need to create 2 workbook objects.
Sheet inputWorkSheet = inputFile.getSheet("Sheet1");
Sheet outputWorkSheet = outputFile.getSheet("Sheet2");
You should be able to get a detailed api of jxl.jar online using which you can read and write cells in your excel. Here is the link for the documentation of classes and objects:
http://jexcelapi.sourceforge.net/resour ... index.html
Hope this helps.
Regards,
Deepesh Jain
Related Content
Recent Discussions
- 6 hours agoruchisingh