XML file to be split into 3 XML files
Phie
-
lami20j Posted messages 21506 Registration date Status Moderator, Security Contributor Last intervention -
lami20j Posted messages 21506 Registration date Status Moderator, Security Contributor Last intervention -
Hello,
I want to split a xml file into three xml files of roughly equal size.
I tried the function csplit -f fic_ test.xml '/<riskAggregatedMessage>/' '{*}' and I have two problems:
1) this function gives me one file per record instead of correctly splitting into 3 files with respect to the tags... this forces me to concatenate the files afterwards... if I could avoid that, it would be great!
2) the option '{*}' does not work. I get the following error message: "csplit: Illegal repeat count: {*}"
Why?
Thanks in advance!
phie
I want to split a xml file into three xml files of roughly equal size.
I tried the function csplit -f fic_ test.xml '/<riskAggregatedMessage>/' '{*}' and I have two problems:
1) this function gives me one file per record instead of correctly splitting into 3 files with respect to the tags... this forces me to concatenate the files afterwards... if I could avoid that, it would be great!
2) the option '{*}' does not work. I get the following error message: "csplit: Illegal repeat count: {*}"
Why?
Thanks in advance!
phie
Configuration: Windows XP Firefox 2.0.0.11
3 answers
-
Hi,
http://www.commentcamarche.net/faq/sujet 953 linux splitting a file into multiple parts
--
106485010510997108 -
Re,
You can then calculate the number of characters and then with a script divide it into 3, taking as conditions the division by three as well as the position of the opening/closing tag at the beginning and end of each part
--
106485010510997108 -
Hi,
put your file on cjoint.com and I'll check it out tonight
--
106485010510997108