This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I just wanted to know how to get the data from the files such as .txt file/excel file /.doc file /.csv file as an input and store it to store in the database in a JSP. The scenario is as follows:- a) The text file contains the questions and 4 Options b) my web app should recognise the question and put it in the database and like wise the respective questions should be stored in the database..
So how to distinguish the question and options and the correct answers from the these files.. .txt file/excel file /.doc file /.csv file
Looking forward fo r your replies at the earliest.
That depends on the layout of the data in the file, doesn't it? Java can read any of these file types (for XLS and DOC, there's the Jakarta POI library), but that won't help you much if the file contents are not regular in some fashion.
Is your question about how to parse files that don't have a fixed layout, is it about reading different types of files, is it about storing data to a database, or is it actually about JSP (since this is the JSP forum) ?
Joined: Jan 16, 2005
Firstly i would like to thank you for your reply. As far as my question is concerned.. its about parsing the file.. and extracting the data ie(questions and options, correct answer) from the file of different extensions using a JSP page and uploading the same to the Database. hope my question is clear now!! expecting your reply at earliest.
As you had mentioned about the POI Library , do let know like how it can help me to solve this..
Thank you Ranganath.S
Joined: Mar 22, 2005
Actually, your question is not clear. If it is about all of these points, you should outline what you have done so far, so that we can see where you are stuck, and try to help you get going again.
Jakarta POI is a library that can read and write Word and Excel files. Its web site goes into a lot of detail on that, and has a bunch of examples.