• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JXL to edit an existing excel sheet withe new data

 
m sandeep
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]
 
Martijn Verburg
author
Bartender
Posts: 3275
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???


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read: EaseUp
 
patil kasinath
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.
 
Mithilesh Kumar
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic