Re: Split file by contents




Davide Bianchi 寫道:

On 2006-09-27, howa <howachen@xxxxxxxxx> wrote:
how to split a large XML file without a XML parser (since a few GB
data)

use ed:

ed - -s yourfilenamehere <<EOF > /dev/null
1
/^<book>$/
.,/^<\/book>$/w newfilenamehere
q
EOF

man ed for more info
Note: not tested.

Davide

--
Security-wise, NT is a server with a "Kick me" sign taped to it.
--Peter Gutmann

Hello, as my file is very large, so use of `sed` is better ?

.


Quantcast