Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Copy a single column of a excel sheet to other excel sheet
Prasad Rooge
Greenhorn
Posts: 25
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
is it possible to copy a single column of a excel sheet to other excel sheet??
Tero Muhonen
Greenhorn
Posts: 1
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Prasad,
I would take a look Apache POI API (
http://poi.apache.org/
). Here's an example from the POI guide:
InputStream inp = new FileInputStream("workbook.xls"); //InputStream inp = new FileInputStream("workbook.xlsx"); Workbook wb = WorkbookFactory.create(inp); Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(2); Cell cell = row.getCell(3); if (cell == null) cell = row.createCell(3); cell.setCellType(Cell.CELL_TYPE_STRING); cell.setCellValue("a test"); // Write the output to a file FileOutputStream fileOut = new FileOutputStream("workbook.xls"); wb.write(fileOut); fileOut.close();
Prasad Rooge
Greenhorn
Posts: 25
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
well i did it using
JXL
...
Workbook workbook = Workbook.getWorkbook(new File("new.xls")); Sheet sheet = workbook.getSheet(0); Cell policies[] = sheet.getColumn(1);
Thanks anyways
Campbell Ritchie
Marshal
Posts: 79178
377
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you for the solutions, and welcome to the Ranch both of you
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Generating protected excel sheets
accessing excel file from java
. reading data from MS EXcel using apache poi api
Error while transferring data from Excel to MS Access
Creating Multiple worsheets in Excel document using servlets
More...