srikotesh
asked on
how to create the textfiles based on excel sheet content using java
hi
i have one excel sheet it contains two columns
one column contains exachange id
another column contains requested xml
from this excel sheet i have to create txt files
by using exchange id i have to create txtfilename
this file containss second column request xml data
how many exchangeids are there in excel sheet those many txt files i have to create
and insert request xmls into it.
can any one suggest how to do it using java
Thanks
i have one excel sheet it contains two columns
one column contains exachange id
another column contains requested xml
from this excel sheet i have to create txt files
by using exchange id i have to create txtfilename
this file containss second column request xml data
how many exchangeids are there in excel sheet those many txt files i have to create
and insert request xmls into it.
can any one suggest how to do it using java
Thanks
Excel sheet can serve as a java data source via ODBC-JDBC bridge.
ASKER
i know how to read the data from excel sheet using java program
after that i have create txt file and i have to add xml into it.
after that i have create txt file and i have to add xml into it.
Can you show a few sample rows from your spreadsheet and, using those rows, create the text file you would like as a result?
Really do need to see a sample of the workbook. Is there only one worksheet? Do you want a text file for each xml value in the spreadsheet? Are there headers in the worksheet? Is there any modification to the xml required? Are you looking to create files with .txt extensions or with .xml extensions? I do a lot of this stuff (mostly in the other direction - xml to xls, though) and just need to get a clearer picture of what you need.
Do you still need help with this?
ASKER
HI awking00,
Sorry for the delay,
yes i need help please see the attached excel sheet.
REQUEST-XML.xlsx
Sorry for the delay,
yes i need help please see the attached excel sheet.
REQUEST-XML.xlsx
ASKER
please see my answers for your questions
Do you want a text file for each xml value in the spreadsheet?
yes i need a txt file for each xml
Are you looking to create files with .txt extensions or with .xml extensions?
i am looking for .txt extension
Do you want a text file for each xml value in the spreadsheet?
yes i need a txt file for each xml
Are you looking to create files with .txt extensions or with .xml extensions?
i am looking for .txt extension
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
while running this program i am getting the below exception
i tried with .xls and .xlsx formats but still i am getting this error
java.lang.NoClassDefFoundE rror: InvalidFormatException
Caused by: java.lang.ClassNotFoundExc eption: InvalidFormatException
i tried with .xls and .xlsx formats but still i am getting this error
java.lang.NoClassDefFoundE
Caused by: java.lang.ClassNotFoundExc
ASKER
above issue is resolved now i am gettting
java.lang.ArrayIndexOutOfB oundsExcep tion: 0
at com.org.XMLFileConverter.m ain(XMLFil eConverter .java:25)
java.lang.ArrayIndexOutOfB
at com.org.XMLFileConverter.m
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for srikotesh's comment #a40517468
for the following reason:
I got the proper solution what i am looking.Thx
Accepted answer: 0 points for srikotesh's comment #a40517468
for the following reason:
I got the proper solution what i am looking.Thx
Could you point us to the answer that is the "proper solution", or detail different approach you took?
>>I got the proper solution what i am looking.<<
Can you please post the "proper solution"?
Can you please post the "proper solution"?
ASKER
hi awking00,
whatever u gave the code that works for me
after removing the line
String xlsFilename = args[0]; from the above code.
whatever u gave the code that works for me
after removing the line
String xlsFilename = args[0]; from the above code.
ASKER
Thanks for u suggestions