• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I split one XML file into Two files

 
BalaiahRaju ChamarthiRaju
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a task need to split one xml file into two files. this is because of my application supports only 5MB xml to load.. rarely I am getting 10MB files also, such scenarios my application is not able to load the file.

Please give me light on this whether is there any tool or any mechanism to split XML file.

Thanks in Advance
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you could write a piece of custom Java which split the file if if gets beyond a certain file size. The tricky part will be deciding where to split that file and whether or not you need to merge that file back together...
 
Paul Clapham
Sheriff
Posts: 20998
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to extract a subset of the file (a generalization of your "split one file into two files"), a common way to do that is with a SAX filter. Google the expression for examples.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic