How to extract data from an arbitrary xml file and export in a nice csv file?

Hallo,
I'm facing big problems in the use of XML files. I have an
application which generates XML files with clusters containing arrays
and scalars like in the example pasted below. My task is to
read it and export the data in a human-friendly CSV document.
Since I don't know the actual content of the cluster, I need some kind
of intelligent vi which goes through the XML file looking for arrays
and other data structures in order to export them properly in the CSV
format (columns with headers).
Thank you
<Cluster>
<Name></Name>
<NumElts>3</NumElts>
<Array>
<Name></Name>
<Dimsize>6</Dimsize>
<I32>
<Name></Name>
<Val>0</Val>
</I32>
<I32>
<Name></Name>
<Val>1</Val>
</I32>
<I32>
<Name></Name>
<Val>2</Val>
</I32>
<I32>
<Name></Name>
<Val>3</Val>
</I32>
<I32>
<Name></Name>
<Val>4</Val>
</I32>
<I32>
<Name></Name>
<Val>5</Val>
</I32>
</Array>
<DBL>
<Name></Name>
<Val>3.14159265358979</Val>
</DBL>
<String>
<Name></Name>
<Val>ciao</Val>
</String>
</Cluster>
Solved!
Go to Solution.

Thank you again,
I'm forwarding my vi draft with many comments and an xml file sample.
Data in cluster is stored according to the LabVIEW schema, infact it is generated by LabVIEW.
What I'm trying to do is to access the element of the cluster and read their content using the Invoke node and Property node functions. Could you give it a look, there may be something wrong, I'm not able to access cluster children.
Which funcions should I use? Could you give me an example? You may use the draft I enclosed...
Then write these data in a csv file
should be the easier part.
BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}
  <?xml
version="1.0" encoding="iso-8859-1" ?>
 <Contents type="Data"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XMLSection.xsd">
 <section name="beta"
date="7/31/2009" time="3:43:03 PM" version="1.0">
 <Cluster>
  <Name />
  <NumElts>1</NumElts>
 <Array>
  <Name />
  <Dimsize>4</Dimsize>
 <DBL>
  <Name>number: 0 to 1</Name>
  <Val>0.93317638164326</Val>
  </DBL>
 <DBL>
  <Name>number: 0 to 1</Name>
  <Val>0.79233924020314</Val>
  </DBL>
 <DBL>
  <Name>number: 0 to 1</Name>
  <Val>0.39199947274518</Val>
  </DBL>
 <DBL>
  <Name>number: 0 to 1</Name>
  <Val>0.74817197429441</Val>
  </DBL>
  </Array>
  </Cluster>
  </section>
  </Contents>
Attachments:
read_array.vi ‏12 KB

Similar Messages

  • How to extract data from ORCL GL in "full" and not "delta " with FDM ERPI?

    Hi
    I am using FDM ERPI 11.1.2.1 to extrct data from Oracle eBS 11.
    I can see that FDM ERPI extracts data in "delta mode" using the GL_TRACK_BALANCES_DELTA (FDM adds a row in this table after the 1st load of the period").
    Is it possible to force the "full mode" in order to reload all the data from Oracle GL for each FDM data load?
    Because I don't know why, but I have each month rows which are not imported into FDM.
    thanks in advance for your help
    Fanny

    Hi
    I had see that I have to install the FDM 11.1.2.1.502 patch in order to see this option in my ERPI adapter options.
    I have passed this patch.
    So I have the ERPI-FIN-C1 adaptor.
    I can see a new option (Time Out Value) but no "Load Data" or "Execution mode" option :-(
    Any idea of where the problem come from?
    Fanny

  • How to input data from labview to executable application and export the results back to labview

    I have a simple function written in m file under Matlab enviornment,
    function [c]=myadd2(a,b)
    c=a+b;
    I built it into a executable file (.exe), then I want to call it in labview and get the results.
    I followed this tutorial and some other information on line:
    http://digital.ni.com/public.nsf/allkb/5CF9526FF069EA8E862564C400579DBA
    But I didn't see any telling me how to get the Labview array data input to the EXE file and return the results data back to another indicator in labview.
    Any one have some idea?
    I appreciate the help very much.
    Arnold

    You probably need to include some command line arguments on your executable that would be the name of a file to get the data from. You could also include a command line argument telling that exe where to store the results.
    I am not familiar with Matllab to give you advice on how specifically to do that with your exe though.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to extract data from a dummy email address and insert them into APEX db

    Hi All,
    I am developing a project management system on APEX 4.1.0.00.21.
    A very important function for the system will be - one sends an email in certain format to a dummy email address, then some data will be extracted from the email based on the pre-defined format and inserted into the database my APEX application is using.
    Any idea on how I can make it happen please?
    Thanks,
    Christine

    A very important function for the system will be - one sends an email in certain format to a dummy email address, then some data will be extracted from the email based on the pre-defined format and inserted into the database my APEX application is using.
    Any idea on how I can make it happen please? I agree that this is not really an Apex question, but a more general PL/SQL question.
    There are many approaches, all boiling down to one of these two:
    1) Push: Some process in the mail server sends/forwards information to your database when new mail arrives.
    The language/tools used to do this, and the way it would connect to your database, depends on your environment (what is your operating system? mail server? existing middleware/tools? security protocols used? etc.).
    2) Pull: Some process in the database contacts the mail server and polls for new information.
    Ie. some PL/SQL code would communicate with the mail server. Again, it depends on your environment (what is your operating system? mail server? existing middleware/tools? security protocols used? etc.).
    For example, if you are using Exchange 2007 or newer, it has a web services API:
    http://msdn.microsoft.com/en-us/library/dd877045.aspx
    The challenge here will be to build the correct SOAP requests from PL/SQL, and to handle the security protocols used.
    - Morten
    http://ora-00001.blogspot.com

  • How to extract data from an interactive adobe form and update SAP database

    Hi ,
    I want to create an Interactive Adobe Form with two text fields and a submit button.On click of submit data entered in the text fields should be stored in a ZTable.
    Please let me know the procedure for doing this in ABAP.
    Thanks,
    Prasuna.

    Hi ,
    pls have a look at the link below...
    [http://www.adobe.com/devnet/livecycle/articles/lc_designer_schema_tip.pdf]
    if u r using abap web dynpro application for calling the adobe form than on the CLICK Action of the button give the code :
    zdept is the interface name ..
    method ONACTIONCLICK .
      data:
        Node_Adobe       type ref to If_Wd_Context_Node,
        Node_Zdept       type ref to If_Wd_Context_Node,
        Elem_Zdept       type ref to If_Wd_Context_Element,
        Stru_Zdept       type If_Main_View=>Element_Zdept .
      data wa_zdept type zdept.
    * navigate from <CONTEXT> to <ADOBE> via lead selection
      Node_Adobe = wd_Context->get_Child_Node( Name = IF_MAIN_VIEW=>wdctx_Adobe ).
    * navigate from <ADOBE> to <ZDEPT> via lead selection
      Node_Zdept = Node_Adobe->get_Child_Node( Name = IF_MAIN_VIEW=>wdctx_Zdept ).
    * get element via lead selection
      Elem_Zdept = Node_Zdept->get_Element(  ).
    * get all declared attributes
      Elem_Zdept->get_Static_Attributes(
        importing
          Static_Attributes = Stru_Zdept ).
      wa_zdept-DEPTNO = Stru_Zdept-deptno.
      wa_zdept-DNAME = Stru_Zdept-dname.
      wa_zdept-LOC   = Stru_Zdept-loc.
      insert into zdept values wa_zdept.
    endmethod.
    Hope this helps  !!!
    best of luck !!
    Regards
    Ravi

  • How to extract data from XML file with JavaScript

    HI All
    I am new to this group.
    Can anybody help me regarding XML.
    I want to know How to extract data from XML file with JavaScript.
    And also how to use API for XML
    regards
    Nagaraju

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How to extract data from SAP in FDM 11121

    I came across some documents from version 11113, says there is a SAP adapter, however ,when I check 11121 there's no such adapter, does anyone know how to extract data from SAP in FDM 11121?

    I download a package from Bristlecone, but I dont see any xml files in it, just a bunch of dll and I didn't find any instructions on how to set up/configure in FDM, it just explained how to register in SAP app server and client.
    Hyperion 11113 has readme on sap adapter(Hyperion Readme Template), but I cannot find the same readme file in 11121, all I can find is ERP Integration Adapter document. any idears where I can find at least a readme document?

  • How to extract data from Hyperion essbase and load into essbase application

    Hi Guru,
    I want to extract data from hyperion essbase 1 application and then load to another application of hyperion essbase.
    Can any one know,how to do this.
    Please,suggest LKM and IKM that should be used for this.

    Thank you very much John,
    I am using Report script method not your least like method(Calc script as you mentioned in your blog)...:)
    I don't know how to check logs of essbase.
    what is load rule and how to use that?
    My ODI version is:10.1.3.6.2
    One more think i want to ask you is i don't have hyperion planning as Technology in topology maneger in my ODI.
    Though, in my oracledi\lib\scripts\xml directory, i have TECH_HyperionPlanning.xml
    So,how to import technology to have this OR I need something else for this....
    Edited by: Maulik Vadodariya on 16 Mar, 2011 3:51 PM
    Edited by: Maulik Vadodariya on 16 Mar, 2011 4:11 PM
    Edited by: Maulik Vadodariya on 16 Mar, 2011 4:14 PM
    Edited by: Maulik Vadodariya on 16 Mar, 2011 4:14 PM
    Edited by: Maulik Vadodariya on 16 Mar, 2011 4:15 PM

  • How to extract data from web URL

    I was doing one project which need to extract data from web pages and then analyze these data. the question is how to extract data from there, using html parser? need help, thanks a lot

    I was doing one project which need to extract data
    from web pages and then analyze these data. the
    question is how to extract data from there, using
    html parser? need help, thanks a lotTry this:
    http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html
    Or, like you said yourself, use an HTML parser:
    http://java-source.net/open-source/html-parsers

  • How to extract data from Chart History?

    Dear all, I have read a lot of posts, but still don't understand how to extract data from Chart history.
    Suppose you acquired 1024 points of data every time, then use "build array" to build an array, then send to intensity chart to show, then save the history into a .txt file,  but how to extact data from the file?
    How Labview store the data in the 2D history buffer?
    Anybody has any examples?

    The simplest would be to save the 2D array as a spreadsheet file, the read it back the same way.
    Maybe the attached simple example can give you some ideas (LabVIEW 7.1). Just run it. At any time, press "write to file". At any later time, you can read the save data into the second history chart.
    If you are worried about performance, it might be better to use binary files, but it will be a little more complicated. See how far you get.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    IntensityChartHistorySave.vi ‏79 KB

  • How to extract data from planning book

    nu t apo. need help regarding how to extract data from planning book givn the planning book name , view name & some key figures.
    Total Demand (Key Figure DMDTO):
    o     Forecast
    o     Sales Order
    o     Distribution Demand (Planned)
    o     Distribution Demand (Confirmed)
    o     Distribution Demand (TLB-Confirmed)
    o     Dependent Demand
    Total Receipts (Key Figure RECTO):
    o     Distribution Receipt (Planned)
    o     Distribution Receipt (Confirmed)
    o     Distribution Receipt (TLB-Confirmed)
    o     In-Transit
    o     Production (Planned)
    o     Production (Confirmed)
    o     Manufacture of Co-Products
    Stock on Hand (Key Figure STOCK):
    o     Stock on Hand (Excluding Blocked stock)
    o     Stock on Hand (Including Blocked stock)
    In-Transit Inventory (Cross-company stock transfers)
    Work-in-progress (Planned orders / Process orders with start date in one period and finish date in another period)
    Production (Planned), Production (Confirmed) and Distribution Receipt elements need to be converted based on Goods Receipt date for projected inventory calculation.

    Hello Debadrita,
    Function Module BAPI_PBSRVAPS_GETDETAIL2 or BAPI_PBSRVAPS_GETDETAIL can help you.
    For BAPI BAPI_PBSRVAPS_GETDETAIL, the parameters are:
    1) PLANNINGBOOK - the name of your planning book
    2) DATA_VIEW - name of your data view
    3) KEY_FIGURE_SELECTION - list of key figures you want to read
    4)  SELECTION - selection parameters which describe the attributes of the data you want to read (e.g. the category or brand). This is basically a list of characteristics and characteristic values.
    BAPI_PBSRVAPS_GETDETAIL2 is very similar to BAPI_PBSRVAPS_GETDETAI but is only available from SCM 4.1 onwards.
    For the complete list of parameters, you can go to transaction SE37, enter the function module names above and check out the documentation.
    Please post again if you have questions.
    Hope this helps.

  • How to extract data from ODS to non-SAP system

    Hi,
    Can anybody tell me, step by step, how to extract data from ODS to a non-SAP system?
    Is it possible to do it without programming effort? And is there volume limits for this kind of extraction?
    The non-SAP system is an unix system.
    Thanks in advance
    Ella

    Ella,
    You can look at it from the concept of a BADI / Infospoke
    Extract the data from the ODS to a Flat file / RDBMS using an infospoke. I am not sure as to how the infospoke loads data into the RDBMS ( did it very long ago ) but then you can push it into an RDBMS and I am sure it will be system neutral.
    Hope this helps...
    Arun
    Assign points if it helps

  • How to extract data from custom made Idoc that is not sent

    Hi experts,
    Could you please advise if there is a way how to extract data from custom made idoc (it collects a lot of data from different SAP tables)? Please note that this idoc is not sent as target system is not fully maintained.
    As by now, we would like to verify - what data is extracted now.
    Any help, would be appreciated!

    Hi,
    The fields that are given for each segment have their length given in EDSAPPL table. How you have to map is explained in below example.
    Suppose for segment1, EDSAPPL has 3 fields so below are entries
    SEGMENT          FIELDNAME           LENGTH
    SEGMENT1         FIELD1                   4
    SEGMENT1         FIELD2                   2
    SEGMENT1         FIELD3                   2
    Data in EDID4 would be as follows
    IDOC           SEGMENT                          APPLICATION DATA
    12345         SEGMENT1                        XYZ R Y
    When you are extracting data from these tables into your internal table, mapping has to be as follows:
    FIELD1 = APPLICATIONDATA+0(4)        to read first 4 characters of this field, because the first 4 characters in this field would belong to FIELD1
    Similarly,
    FIELD2 = APPLICATIONDATA+4(2).
    FIELD3 = APPLICATIONDATA+6(2).  
    FIELD1 would have XYZ, FIELD2 = R, FIELD3 = Y
    This would remain true in all cases. So all you need to do is identify which fields you want to extract, and simply code as above to extract the data from this table.
    Hope this was helpful in explaining how to derive the data.

  • How to extract data from oracle database directly in to bi7.0 (net weaver)

    how to extract data from oracle database directly in to bi7.0 (net weaver)? is it something do with EDI? can anybody explain me in detail?
    Thanks
    York

    You can use UDConnect to get from Oracle database in to BW
    <b>Data Transfer with UD Connect -</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
    <b>Prerequisites</b>
    You have installed the SAP WAS J2EE Engine with BI Java components.  You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
    Hope it Helps
    Chetan
    @CP..

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

Maybe you are looking for

  • New Feed URL not updating

    I recently moved my clients podcast feed and set it up (with WP Podpress plugin) with the new feed URL. I submitted it to iTunes but it has yet to show an update: Feed: http://calvaryqc.org/category/sermons/sunday-sermons/feed/ Podcast id: http://itu

  • ODI loading a table like Dimension table

    Hi, I have a table with two columns. Table Name - PROGRAMS. Columns - Pgm_ID, Pgm_Type. What I am trying to accomplish is when I add a new row, I want to keep updating this table. But if the same Pgm_Type already exists, to ignore it. In my model I a

  • Embedding iPix images

    Hi all, I am embedding an iPix image (.ipx) into a page and when I preview it locally, it works, but when I upload to my host it does not. Having checked it with IE it shows a file access error. Any ideas anyone? My code is below. The IpixViewer.clas

  • TS3276 email stuck in outbox

    I have a blast email stuck in my outbox.   how do I delete the email message?  I have about 80 email addresses that I am trying to send . the message has been there since June 2013?

  • Deactivate and deinstallate Premiere Elements 10 and Photoshop

    I want to deactivate and deinstall Premiere Elements 10 and Photoshop as I have purchased and installed Premiere Elements 12. What do I have to do? I have already started a new project with PE 12 and do not want to loose this.