LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Unzip .tar.gz files and Read XML files

    Employee
    Posted 11-19-2009 16:45

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: credoblado

    Hi,

    2 Questions regarding Lavastorm Desktop:

    1) Is it possible to unzip .tar.gz files ?
    2) Is it possible to count the number of records in an XML file ?

    If so, could you please provide sample graphs ?

    Thanks,
    Christina


  • 2.  RE: Unzip .tar.gz files and Read XML files

    Employee
    Posted 11-19-2009 17:42

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mermacora

    Hi Christina

    In both cases, this is certainly possible. However, this functionality is not currently available out of the box using the standard nodes provided in the core library, so you would need to develop a custom python node.
    I have seen python nodes that will un-gzip and/or extract from a tar archive and will try to dig up an example to post to this thread.
    For counting the records in an XML file - the problem here is the nested structure of XML data so you would need to make a decision about which XML tag(s) represents a record in order to count them. I could envisage a python node configured to take the record tag name(s) as a parameter.

    Hope this helps,
    Mario Ermacora


  • 3.  RE: Unzip .tar.gz files and Read XML files

    Employee
    Posted 11-19-2009 19:20

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    Hi Christina

    Mario is correct on both accounts. I just wanted to add that our next release, 4.2, will include an XML reader node, which would make counting up the records very easy. That release should be coming out in the next couple of months, so stay tuned.

    Cheers
    Rich


  • 4.  RE: Unzip .tar.gz files and Read XML files

    Employee
    Posted 11-19-2009 22:26

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mermacora

    Hi Christina

    I've attached an example of a python node which will extract all files from a TAR file (specified in the Archive File parameter). To use, simply copy all the text in the attachment and paste into your graph. This should also work with gziped TAR files (.tar.gz or .tgz) as well.
    I should point out that this node has not been thoroughly tested and is not officially supported by MDA as part of the LAE product . Having said that, let me know (via this forum thread) if you have trouble using it. It should give you an idea of what can be done using a python node.

    Hope this helps,
    Mario Ermacora
    Attachments:
    Extract_TAR_File_brn.txt