aspose file tools*
The moose likes Other Open Source Projects and the fly likes Using JXL to edit an existing excel sheet withe new data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Using JXL to edit an existing excel sheet withe new data" Watch "Using JXL to edit an existing excel sheet withe new data" New topic
Author

Using JXL to edit an existing excel sheet withe new data

m sandeep
Greenhorn

Joined: Jan 24, 2011
Posts: 17
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
m sandeep
Greenhorn

Joined: Jan 24, 2011
Posts: 17
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

Joined: Jan 10, 2002
Posts: 61221
    
  66

Please read: EaseUp


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
patil kasinath
Greenhorn

Joined: Aug 07, 2011
Posts: 5
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

Joined: Aug 07, 2011
Posts: 5
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

Joined: Jun 06, 2013
Posts: 1
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using JXL to edit an existing excel sheet withe new data