Parse to excel?

Hey!
I wonder if i could parse from a Jtable or from text to a excel file?
Using some java code?
I want to have it like a button, "Extract" that should do this.
/Thanks
Mike

Look into POI, which is a Java Library handling Microsoft Office file formats.
Alternatively, you could simply export to a CSV file, which excel can import quite easily (with the added feature that other non-Microsoft Spreadsheets tools can read it as well).

Similar Messages

  • Parsing .xls(excel) file and creating a .xdat(xml) file out of it

    Hi All,
    need some tips on a task i am trying accomplish for some days now.
    I have a excel file, in which I have 10 columns with 40-50 rows of data.
    I have a xml structure in mind, in which I want to put all these data from excel file. But till now I haven't understood exactly how I should go about it step by step.
    Should I first parse the excel file and save each row (with the column names) in a list, and then read through each row and insert them in the xml format i have planned?
    And how do I open a .xdat data and tell my program to insert the data in the sequence of sets I want them to be saved?
    I know it's a pretty newbie question ... but will appreciate any help and tips provided. Would help me a lot to learn this new type of task.
    Thank you.
    with best regards,
    Newbie

    If you are using JAXB you unmarshall to read the xml. Then you marshall to write.
    So what you do is:
    1) Unmarshall your xml document. This means you now have your xml as Java objects.
    2) Read through the Java objects using loops, etc making any changes to the values. I think here you want to add values, so you can set your values
    3) Now in memory you have your new xml thats been updated, so you can marshall it (save it)
    I'd recommend a JAXB tutorial. But the basic steps are:
    1) Create an xml file and insure its valid
    2) Use a free online utility (http://www.hitsw.com/xml_utilites/) to convert the xml into an xml schema (xsd)
    3) Use xjc from the jaxb jar and run it over the xml schema (the command i use is xjc myxmlfile.xsd -p com.example
    4) Step 3 above creates all the java classes for you to use so then you can unmarshall. Process. Then marshall
    This is just a high level. I might have missed something, but the jaxb tutorial is really good and that's how I learned the process.

  • Problem while parsing Rulebase Excel Spreadsheet

    Hi All,
    My program was running using OPA Determination Engine libraries.
    Apparently when trying to parse a rulebase excel spreadsheet, the OPA regards one attribute as unknown even though it has been listed as empty in the excel spreadsheet's cell.
    My Data has this information
    field1 = XXX
    field2 = YYY
    field3 = ZZZ
    field4 = empty
    The excel spreadsheet contains this information
    row1: field1 is empty, field2 is empty, field3 is empty, field4 is AAA
    row2: field1 is XXX, field2 is YYY, field3 is ZZZ, field4 is empty
    Decision Report:
    Can't draw conclusion because
    field1 = XXX
    field2 = YYY
    field3 = ZZZ
    and field4 is unknown
    Any suggestion for this?

    I think you are making this more complicated than it needs to be. Based on your description above of the logic, I wouldn't even be using Excel at all, and I wouldn't be doing it as a rule table in Word either.
    Using dummy attribute text which I'm just making up for the purpose of this example, it sounds like you're logic can be represented with the following simple regular Word rule:
    the person is happy if
    the first text variable = "AAA" or
    all
    .....the first text variable = "XXX" and
    .....the second text variable = "YYY" and
    .....the third text variable = "ZZZ"If you write it as a regular Word rule like this, then the conclusion WILL evaluate to TRUE if the only data you provide is the following:
    the first text variable = "XXX" and
    the second text variable = "YYY" and
    the third text variable = "ZZZ"
    [As an aside... depending on what you're doing and what your real rules actually are, you might also want to separately stick a Boolean attribute over the top of each of these variable attributes and then use the Booleans in the rest of the rulebase. However, I wouldn't bother with the extra Booleans if you're just having a bit of a play around with OPA, or if you're just building a simple little demo.
    If you are doing anything more than just having a bit of a look at OPA, then I strongly suggest that you consider some proper OPA training anyway.]

  • Extract text from PDF and parse to Excel, automator? applescript?

    I'd been trying to do this with automator and have been getting nowhere. 
    I have some pdf files that have selectable, formatted text in them.
    Its an old college directory that I would like to import.  There are chunks of text:
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    etc.
    I'd like to find a way to extract the names, the phone numbers, and the hometowns and get it all into those respective columns in excel.  Seems that I don't stand a chance with automator.  Do I need a programmer for this?

    I'd been trying to do this with automator and have been getting nowhere. 
    I have some pdf files that have selectable, formatted text in them.
    Its an old college directory that I would like to import.  There are chunks of text:
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    etc.
    I'd like to find a way to extract the names, the phone numbers, and the hometowns and get it all into those respective columns in excel.  Seems that I don't stand a chance with automator.  Do I need a programmer for this?

  • Parse Excel File

    Hi there.
    I'm using JExcel to parse an excel file.
    The issue is that I get a out of heap memory error.
    The excel row size is about 600+ records and 13 columns wide.
    I could go and increase the heap size with net beans, but ultimately I
    want to package my class files at the end into an executable jar file.
    Supposing then I run my jar on another machine, is there some sort of instruction
    I can include in my jar file to increase the heap memory so that the same issue won't occur
    when my jar is run by another JVM?
    Is there another excel reader out there that doesn't parse the entire
    file into memory? If not, I might just work with a csv file and utilize JavaCSV API
    instead. This seems to run off streams and I wouldn't imagine it parses the entire
    file into memory.
    Thank you very much.

    is there some sort of instruction I can include in my jar file to increase the heap memory so that the same issue won't occur when my jar is run by another JVM?There is an option to set the heap size but it has to be applied to the java command that starts Java, and won't work in a jar.
    See the -Xmxn option: [http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html]

  • Refresh Excel Data in OfficeControl

    Hey,
    I have seen a few posts about loading SAP data from an internal table and downloading to Excel.  But is there a way to refresh the Excel data without downloading? 
    Scenario:  User uploads Excel sheet into WD4A app.  A button is pushed on the Web Dynpro application and the data is refreshed in the Excel sheet.
    Thanks,
    Kenneth

    The OLE2 functions in ABAP (which would allow this tight integration) seem to use the GUI to serve the OLE2 requests -
    [ABAP/4 OLE Automation Controller|http://help.sap.com/printdocu/core/print46c/en/data/pdf/bcfesde6/bcfesde6.pdf]
    so I don't think you could use these.
    However, the OfficeControl UI element should allow you some sort of control.  Check the doco there - looks like you could do some pretty interesting things if you had a macro in your spreadsheet to allow you to do them!
    Although from your question you seem more to want to be able to parse an Excel spreadsheet  from a download and then regenerate it with some fields changed - probably more a question to throw open to the ABAP forum

  • Upload Excel data to Sharepoint list VIA infopath form

    Hi,
    I'll try to explain the process of what I want to do first.
    1. In Excel
    I have an exceldocument (XLS, XLSX or XLSM) with 4 named columns and a named worksheet saved locally on my computer.
    I want to upload this data into preferably a custom list in sharepoint but it needs to run via a infopath template first.
    2. In Infopath
    The Infopath template will prompt the user to specify values in 2 additional fields.
    After giving input to these fields user may browse for the locally stored excel document and upload the document.
    In the same infopath template a dynamic array should be visible containing 6 columns (4 from excel + 2 from headerlevel of template) and the amount of rows based on the number of rows from excelsheet.
    At the end of template a submit button is found for uploading the entire array into sharepoint custom list.
    Is this possible to do at all?
    NOTE! End user should not have to save the excelsheet as XML file nor do a XML mapping.
    Infopath should, perhaps with help of VBA read excelsheet and transfer data to correct destination in sharepoint on it self.
    Looking forward to your reply

    Hi Jonas,
    You can attach your Excel doucment into InfoPath form and send InfoPath form to a custom web service. Then you can parse the Excel data and combine the Excel data and additional fields into SharePoint list in the customized  web service.
    For more information, you can have a look at the thread:
    http://dandeng.blogspot.com/2012/03/submit-infopath-form-data-to-web.html
    http://www.codeproject.com/Articles/88547/Submit-entire-InfoPath-form-to-web-service
    https://social.msdn.microsoft.com/Forums/office/en-US/590f1e78-5c08-47bd-8af4-9709102b568d/webservice-to-send-attachments-in-infopath-form-to-different-location?forum=sharepointcustomization
    https://msdn.microsoft.com/en-us/library/office/gg575571.aspx?f=255&MSPPError=-2147217396
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • SSIS 2012: SSIS Error Code "Excel Connection Manager" failed with error code 0xC0202009.

    Hi,
    This is kind of weird issue that I am experiencing with excel connection manager in SSIS 2012. This issue occurs sometimes but when I close and re-open SSDT (SQL Server Data Tools - newer BIDS) then this issues goes off temporarily.
    Just FYI, through SSDT environment I executed the package successfully with both settings Run64bit runtime setting to Yes and No when error does not occur.
    So far I have installed
    http://www.microsoft.com/en-us/download/details.aspx?id=13255 (Microsoft Access Database Engine 2010 Redistributable).
    I still remember for older versions of SQL Server (2005 & 2008) that I have executed Excel connection SSIS packages with Run64bit runtime = false i.e. in 32-bit mode. As far as I know I think Excel 64-bit issue has been resolved with SQL Server
    2012 release.
    Here is the detail of error message:
    TITLE: Package Validation Error
    Package Validation Error
    ADDITIONAL INFORMATION:
    Error at Data Flow Task [Excel Source [2]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection
    Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    Error at Data Flow Task [SSIS.Pipeline]: Excel Source failed validation and returned error code 0xC020801C.
    Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
    Error at Data Flow Task: There were errors during task validation.
    Error at Package [Connection manager "Excel Connection Manager"]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "Unspecified error".
     (Microsoft.DataTransformationServices.VsIntegration)
    Here are my environment details:
    SQL Server 2012 {Microsoft SQL Server 2012 (SP1) - 11.0.3368.0 (X64) } , Excel 2010 (32-bit). I am developing SSIS code on Virtual desktops with Windows 7 32-bit OS.
    Also it occurred to me that since Virtual Desktops are on Shared Infrastructure, the source files and SSIS packages (code) can be on Shared drives for e.g. \\<Corpnet>\userdata\<Corp_Users_Grp>\<Username>\Visual Studio 2010\Projects\Integration
    Services Project2\Integration Services Project2\Package.dtsx.
    Does this kind of Shared drives have any impact to give this issue?
    Thanks in advance!
    Ketan
    P.S.: I had look at this forum question -->
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/903bbe1d-e070-4c43-9d3b-0a5193550029/64bit-error-in-excel-connection-manager-in-ssis

    Hi Arthur,
    Thanks for your response.
    Yes, it looks like SSIS still has bunch of issues with Excel files like as follows:
    1) Some times excel source files cannot be parsed by excel source connection manager.
    2) For derive column conversion, we can't replace the existing column. rather, we have to add the derived column as " add as new column" which is tough to manage  while destination mapping.
    3) If an column in excel contains a data which is not of the data type assigned for the column in excel, the excel source reads that data as "null". For the same, we can't validate the data and redirect the erroneous data in reject file.  <-- For
    this we tried IMEX setting also
    4) In multi-tab/sheet excel file, excel source is unable to detect a tab and identify the metadata of the excel.
    I am also checking Microsoft connect for Excel issues with SSIS 2012(https://connect.microsoft.com/SQLServer/SearchResults.aspx?SearchQuery=excel#&&PageIndex=22
    As worst case scenario, I am thinking of converting Excel to CSV file or Flat text file. (http://www.mssqltips.com/sqlservertip/2772/importing-data-from-excel-using-ssis--part-2/).
    Do you think it is advisable to convert Excel into CSV or Flat file.
    Thanks,
    Ketan

  • Convert Excel to XML file

    Hi Guys,
    I need to generate the XML from Excel file. The XML file will have the definition like this:
    <people_list>
    <name>Fred Bloggs</name>
    <birthdate>27/11/2008</birthdate>
    <gender>Male</gender>
    </people_list>
    The Excel file will look like this:
    A B C
    1 Fred Bloggs 10/21/2008 Male
    2 ABC 12/23/2008 Female
    3 XYZ 07/16/2008 Male
    All the values in name,birthdaye,gender will come from the Excel file. I am having 100 rows in the Excel file with the data and I want to parse this excel file and create the XML file with the above template.
    Any ideas how to do this?
    Thanks,
    Mahesh

    Hi Mahesh,
    there are tons of ways to do what you need. It all depends on how your workflow is organized and how complicated it may become.
    Alternative 1:
    Export your Excel file as a cvs and convert cvs to XML (which shouldn't be so hard).
    Pro: Relative easy transformation.
    Con: Every time you want to convert the Excel file to XML you first needs to export it out of Excel by a manual step.
    Alternative 2:
    Save you Excel file as XML (e. g. the new *.xslx documents) and transform it as you like.
    Pro: Very clean way to do this. You can access the single source Excel file directly from Java. No further steps needed.
    Con: It's very very hard to program because the Excel xml structure is ridiculously complex.
    Alternative 3:
    You can create a little Excel VBA Script which generates the XML File.
    Pro: Easy programing.
    Con: Needs some experience in Visual Basic 6 programming.
    Alternative 4:
    Use http://jexcelapi.sourceforge.net/ or any other Excel-API to Access the Excel application out of Java.
    Pro: Clean way to do it. You need no further manual actions to prepare something. (maybe the most flexible and at the same time easyest way)
    Con: Additional license.
    Best Wishes
    esprimo

  • Blank row in excel

    Hi Experts,
    while uploading an excel sheet having data from my system in a context node, i m getting a blank row in the node.
    But my requiremenet is , if there is any blank row in the excel sheet then it shuld not get into the context nodei.e while parsing my excel sheet into a node, no empty rows details must be there in node..
    provide a soln for it.
    regards,
    anand

    Hi,
    If possible pls post the code you are using to read the excel and to populate that data into node. You need to keep the condition while creating a new element to node everytime whether the row is blank or not.
    Regards,
    Charan

  • How to edit Excel files online

    HI, is it possible to edit Excel files online, which where uploaded to webserver. I mean, opening an ecxel sheet changing different fields, and saving the changes without opening the .xls with my local office?
    If yes, how?

    you could try it with http://jakarta.apache.org/poi
    That is a package that allows reading and writing of excel files, it wont be easy as you have to parse the excell file into HTMl that is editable.

  • Jakarta POI Excel97-2000 (Excel 2003?)

    Hi All
    I need to read data from Excel 2003 spreadsheet using my java program.
    I looked at Jakarta POI, and JDBC-ODBC bridge options.
    POI says Excel97-2000
    Creating system DSN does not show Excel 2003 options. It shows Excel97-2000, Excel 3.0 etc
    My environment is Windows XP 2002.
    Can I read Excel 2003 documents using POI?
    If I deploy this program on a machine which has earlier versions of excel on it will it be able to read.
    I just have plain text in excel spreadsheet.
    Please let me know.
    Thanks
    bib

    Hard to answer this question definitively because it very much depends upon exactly what is in the file. If you have saved a complex, formatted document that makes extensive use of features that were introduced into Excel for version 2003 then you will face problems. If the file contains simply plain text, then you should be fine. Most of the API authors base their product on an earlier version of the BIFF8 format to ensure compatibility with as wide a range of Excel versions as possible. That is why they all mention that the API will handle files that are based upon a specific version of Excel. Hopefully, you will be fine distributing the application onto machines that run earlier versions of Excel.
    By the way, have you also considered JExcel? It handles a few things differently to HSSF (POI) and you may prefer the way it approaches parsing an Excel spreadsheet file and exposing it's contents.

  • NI Requirements Gateway 2012 and Excel

    Hi,
    Just a short question. I have an excel file wich is saved as .xml. I would like to use it in NI-RG 2012.
    Only .xls and .xlsx were supported.
    I there a posibility to use my .xml file
    Regards
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

    Hi Juergen,
    Unfortunately there is no built-in type to parse .xml excel files, only the .xls and .xlsx files are supported, as you mentioned.  However, you could create a custom XML type to read this data.  To do so, open the Types tab in the configuration window, and click the New XML Type button at the bottom left.
    Refer to the Types topic in the Requirements Gateway help for more info on creating and customizing types.
    Al B.
    Staff Software Engineer - TestStand
    CTA/CLD

  • Excel Attachment via Email into PI

    I have a shipping partner that says they can only email me a large Excel file for the requested delivery information (for R3 update).  I want to have the entire process automated. 
    I have seen a couple threads concerning using Conversion Agent or a writing a java module in order to parse an Excel document.  But from what I have seen in blog 1967, doing it with Java for a large Excel file seems like it would be a large pain.
    Any suggestions or recommendations (Java module versus Conversion Agent or other)?
    Thanks,
    Keith

    Hi Keith !
    It depends on the complexity of the excel file itself, and also on the availability of the conversion agent tool and the knowledge in java development. Using Conversion Agent you will need almost none development (depending on the sheet).
    Also another idea could be, that if the sender uses Excel, the also can export the file as CSV or XML, allowing  you to read it from a standard adapter into XI.
    Regards,
    Matias
    ps: please award points if helpful.

  • Excel linux

    Hi, I have a question in regard of a set up data source using excel in RHEL 5 for OBIEE 11G. Which odbc driver to use and setting/configuration in RHEL? Thx

    Now, seriously you would not be asking about strategies to transfer information from Excel to Oracle! These are kind of job you usually get paid for :) - Just joking of course.
    Please state your requirement correctly, there could be other ways to get the job done without trying to write a parser for Excel on Linux.
    Ironluca

Maybe you are looking for

  • External drives won't sleep properly

    Hi I have my preferences set to allow drives to sleep when possible. In Tiger this meant that my external drives slept most of the time. They would awaken only when directly accessed by the Finder or an application. In Leopard my externals are consta

  • How to make changes to .fmx file using the form builder

    Hi all I have a .fmx form in the AR_TOP directory of the Oracle E-business suite.Now I need to make some changes to the form and compile it and place it back .But the .fmx file didnot open using the form builder 6i .So is there any way that i can con

  • [iPhone] how to detect the exact model

    Hi, is there a way to detect what model is running the app? [[UiDevice currentDevice] model] only returns 'iPhone' or 'iPod'... and not 'iPhone 3G' or 'iPod Touch'/'iPod Touch 2nd generation'. Whereas a different model information appears in settings

  • MBP shuts down when lid half closed

    Hope for some feedback. Quite a while ago (several months at least) I noticed that when I closed the lid the computer shut off rather than went to sleep. It seemed kind of random at first, and taking it in is a hassle. I did the troubleshooting at th

  • My system shuts down when i ask it to sleep.. Help??!!

    I have The operating system Windows 8.1. When i close the laptop or ask it to sleep it closes without a problem. On restart all the programs i had open are closed and it reboots as if i shut the laptop down rather than asked it to sleep. I'm doing my