我正在处理xml文件但不幸的是我的xml文件变大了。所以现在我想将我的xml文件拆分成多个较小的xml文件。是否可以将一个大型xml文件拆分为多个较小的xml文件。
例如如果我们用c语言创建任何项目,那么我们创建多个c文件,但main函数将始终存在于一个c文件中。我们保存在不同c文件中的所有其他函数或子程序。因此,如果我们必须调用任何函数,我们从具有main函数的c文件中调用它。
与我想要的xml文件相同或类似,其中将有一个主xml文件,所有其他xml文件将依赖于主xml文件。
简单来说,我想将我的大型xml文件拆分为更小的xml文件。我对此一无所知。我请求你们所有的请分享一个例子或链接任何这种事情的例子。 感谢
答案 0 :(得分:0)
如果您只想将文件拆分为较小的部分,可以在终端中使用split
命令。
Usage: split [OPTION] [INPUT [PREFIX]]
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default
size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT
is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-a, --suffix-length=N use suffixes of length N (default 2)
-b, --bytes=SIZE put SIZE bytes per output file
-C, --line-bytes=SIZE put at most SIZE bytes of lines per output file
-d, --numeric-suffixes use numeric suffixes instead of alphabetic
-l, --lines=NUMBER put NUMBER lines per output file
--verbose print a diagnostic to standard error just
before each output file is opened
--help display this help and exit
--version output version information and exit