Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Using JXL to edit an existing excel sheet withe new data  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

i am having an excel sheet say excel1 annd i am having another excel sheet excel2 .I need to transfer the data of excel1 to excel2.Now my problem is whenever i am tring to do it the data present in excel2 is getting lost and new data rom excel1 is getting in excel2 .


Please suggest me with some code to do this .I NEED TO THIS ONLY WITH JXL NOT POI.

REPLY SOON

Thanks
sandeep
MY COde is BELOW


[Edit: added code tags, removed urgent from subject line, ignored shouting]
 
author
Posts: 3281
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi m sandeep and welcome to Javaranch!

I would look at your variables and where they are pointing to very carefully, perhaps splitting the read from sheet 1 and write to sheet 2 into separate methods will help clarify.
 
m sandeep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply.
Can you please elabourate on what you are saying ,If possible can you please paste a code of what you are exacting saying.

I cant lose data from excel 2 i just what even data from excel1 to excel2.

Suppose i have 10 names in excel 1 and 5 names in excel 2 .I want to add the 10 names of excel 1 to excel 2 and make it 25.But i am not sure that how many names will be in excel 2 .So i want to know how to find an empty cell in an excel???


 
Marshal
Posts: 67192
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read: EaseUp
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File f1=new File("c:/sandeepNew/sandy1.xls");
can you please specify the code for path where my file is in server, so how can i read this file
i used ContextPath() method to get path and i mention like this
new File("path/files/test.xls");
im getting FileNotFoundException.
can you please help me, how can i mention path to get that file.
 
patil kasinath
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

patil kasinath wrote: File f1=new File("c:/sandeepNew/sandy1.xls");
can you please specify the code for path where my file is in server, so how can i read this file
i used ContextPath() method to get path and i mention like this
new File("path/files/test.xls");
im getting FileNotFoundException.
can you please help me, how can i mention path to get that file.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Sandeep,

If you want to add the data in excel 1 into excel 2, you can do so by creating a writable workbook file from excel 2. but it must be a new file. so instead of


use something like:



and do all the changes in workbook1. workbook1 will be your desired result.
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!