8000 GitHub - clementyu/xml_split_to_json: A sample to split large xml file and encode the split xml into JSON
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

clementyu/xml_split_to_json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xml_split_to_json

A sample to split large xml file and encode the split xml array. Most sample codes of using xml-split are for the smaller XML files. If you are dealing with extremely large XML files, you can take a look at this one.

Prerequisites

  $ npm install xml2js 

Usage

XML-Splitter

  • To split a large XML file into smaller one:
  $ node xmlsplitter.js /your/path/to/the/large.xml <xml-tag-of-the-array> <batch-size>

for instance, To split a large XML array composed by elements with tag in an XML file /home/user/the_array.xml into small pieces. For each piece, there are 500 elements:

  $ node xmlsplitter.js /home/user/the_array.xml the-array-member 500

XML to JSON

  $ node xml_to_json.js <xml-file>

For instance, to encode foo.xml, just do

  $ node xml_to_json.js foo.xml

and then a file foo.json will be saved in the same folder.

About

A sample to split large xml file and encode the split xml into JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0