How to SORT a large XML file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DOLE
    New Member
    • Feb 2007
    • 3

    How to SORT a large XML file?

    I am searching for a way to sort XML data on very large files on a UNIX enviroment. Also, I am very new to XML and UNIX as I am an IBM Mainframe person. Any help or examples would be appreciated.

    Thanks
    DOLE
  • Varun Gupta
    New Member
    • Feb 2007
    • 13

    #2
    Originally posted by DOLE
    I am searching for a way to sort XML data on very large files on a UNIX enviroment. Also, I am very new to XML and UNIX as I am an IBM Mainframe person. Any help or examples would be appreciated.

    Thanks
    DOLE
    ---------------------------------------
    Hi

    You can store XML files in flat files in unix , extension hardly means in unix becoz unix treates all the devices and folders as files. but then type of file could differ.
    To sort file you can use sort command OR for sort on the basis of particular patterns in that file you better can use sed / awk commands.

    sed 'script' filename

    where script contains..
    /pattern/ action
    here /pattern/ which you want to search for sorting and
    action is ..what ever ou want to perform on the file. (as you want sorting as an action on the pattern.)

    Comment

    • ghostdog74
      Recognized Expert Contributor
      • Apr 2006
      • 511

      #3
      Originally posted by DOLE
      I am searching for a way to sort XML data on very large files on a UNIX enviroment. Also, I am very new to XML and UNIX as I am an IBM Mainframe person. Any help or examples would be appreciated.

      Thanks
      DOLE
      For XML manipulation, you can use powerful languages such as Perl/Python that comes with XML parsers that makes parsing XML easy. I am sure you have these tools available on your machine.
      eg Perl XML parser . If not, sed/awk and the likes of Unix tools can also be used, albeit a bit tedious.

      Comment

      • davidf2007
        New Member
        • May 2007
        • 1

        #4
        CoSort for Unix, Version 9, now sorts (and converts to/from) large, flat XML files, among other mainframe (index) and sequential (csv, ldif, etc.) file formats. CoSort also has JCL sort parm conversion tools for MVS and VSE migrations.

        Please see

        Comment

        • Motoma
          Recognized Expert Specialist
          • Jan 2007
          • 3236

          #5
          Regular expressions are always a solid way to go.

          Comment

          • ghostdog74
            Recognized Expert Contributor
            • Apr 2006
            • 511

            #6
            regexp are powerful, but it also depends. if the code is full of regexp, and if something breaks, they make it difficult for administrator/code maintainer to debug and troubleshoot.

            Comment

            • David Friedland

              #7
              CoSort 9.1.3 also runs on Windows for large, flat XML file sorts.

              Comment

              Working...