?
Solved

Need help to convert CSV to Excel suing java or pl/sql

Posted on 2010-01-11
14
Medium Priority
?
1,046 Views
Last Modified: 2013-12-22
Hi,

I want to convert the CSV file Excel sheet using java code with out using POI.
Please help asap.
Thanks,
Rama
0
Comment
Question by:ramadevimandala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 3
  • +1
14 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 26283577
0
 
LVL 14

Expert Comment

by:shru_0409
ID: 26283635
0
 

Author Comment

by:ramadevimandala
ID: 26283735
This will convert excel to CSV right? I want to convert CSV to excel.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 26283779
did you tried the link that i posted?
0
 

Author Comment

by:ramadevimandala
ID: 26283821
Thank you for your help.Ya I have tried but I am notable apply for my code, I am generating the CSV and placing that on the server so I need to read that and create the excel on the server and I dont have any web.xml  I am using OAF with JSP .
0
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 1000 total points
ID: 26283847
<<Ya I have tried but I am notable apply for my code>>
<<I dont have any web.xml >>
Could you please expand on this?

You need web.xml if you want to make any web-application...let alone the JSP.  :)
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 26284228
Converting CSV to Excel means producing a binary file in the MS Excel format.

We use JExcel, which works fine, but other Java packages are available to produce Excel files.
http://jexcelapi.sourceforge.net/

If your data is in a .csv file, then you will have to read in that data to your Java program, then write out a .xls file.

At that point, you can change your response header to the .xls file name.
0
 

Author Comment

by:ramadevimandala
ID: 26290857
I dont want read the CSV file line by line as it is slow process for big file, is there any way i can do save as excel kind of thing?
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 26290982
@ramadevimandala: You haven't responded to my reply #26283847.
0
 

Author Comment

by:ramadevimandala
ID: 26291336
Yes I am using just jsp code as explained in previous comment I cant use the code which reads line by line csv and loads to excel sheet.
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 26291456
If Apache POI is out of question, then can you use JExcel?
http://www.rgagnon.com/javadetails/java-0516.html

0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 26292679
>I dont want read the CSV file line by line as it is slow process for big file, is there any way i can do save as excel kind of thing?

Are you saying that you currently create a CSV file from your data, and you'd prefer to save it as a .xls file?  In that case, you can use the calls from the JExcel api (as I mentioned in a previous comment above) to save the file as a .xls file from the beginning.

There's no 1-line Java call which matches "save as Excel".  MS Excel does a lot under the covers when you do that.  It is possible to build a COM object for calling MS Excel from a Java program, but it's very difficult to get that to work.  Plus, it will still be slow when you do it for a big file.  The Java JExcel calls will be faster.
0
 

Author Comment

by:ramadevimandala
ID: 26292779
Ok Thank you for help.
I have clicked on the link http://jexcelapi.sourceforge.net/ it opens the links and api, could you give any sample code which do the save as xls?
0
 
LVL 27

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 1000 total points
ID: 26293321
If you click on the FAQ link:
http://jexcelapi.sourceforge.net/resources/faq/
you'll see example code.

Try it and see how it works.  If you have problems, post your code here with the exceptions you're getting.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question