示例文件:(注意:通常每个“列表”xml节点应该在它自己的行上)
<?xml version="1.0" enCoding="UTF-8"?><Listings><Listing><date>2009-09-22</date><desc>This is a description WITHOUT line breaks and works fine with split</desc><more_Tags>stuff</more_Tags></Listing><Listing><date>2009-09-22</date><desc>This is a reallyannoying description fIEldWITH line breaks that screw the split function</desc><more_Tags>stuff</more_Tags></Listing></Listings>
然后有时我的分裂最终会像
<?xml version="1.0" enCoding="UTF-8"?><Listings><Listing><date>2009-09-22</date><desc>This is a description WITHOUT line breaks and works fine with split</desc><more_Tags>stuff</more_Tags></Listing><Listing><date>2009-09-22</date><desc>This is a reallyannoying description fIEldWITH line breaks ... EOF
所以 – 我一直在阅读“csplit”,听起来它可能有助于解决这个问题.我似乎无法正确表达正确的表达……
基本上我想要〜50ish文件的相同输出
就像是:
*csplit -k myfile.xml '/</Listing>/' 25000 {50}
任何帮助都会很棒
谢谢!
以上是内存溢出为你收集整理的如何使用linux csplit来切割大量的XML文件?全部内容,希望文章能够帮你解决如何使用linux csplit来切割大量的XML文件?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)