怎样用笔记本电脑打开一个100多G的.XML文件?

2025-04-13 20:51:01
推荐回答(2个)
回答1:

个人估计没有软件可以支持这么大的xml文件。

1.先尝试用微软Excel打开,但估计EXCEL可能有65536行的限制,你先尝试下
2.如果不行,就得自己写程序,php或python是好选择。

下面这段是stackflow上类似问题的答案,一个家伙想把17g的xml转存进mysql。你比他还夸张。
You need to use Python's xml.sax or lxml.etree's iterparse().
These are "event-driven" methods of parsing xml. You tell the parser which "node" you want to listen for, and it triggers a function each time it finds that node.
This will keep your memory usage very low, and avoid the errors you are getting.
大致方向就是你需要使用事件驱动或数据流驱动的方式去解析XML,而不是正统DOM解析。这样可以避免内存报错。

回答2:

这个是很困难的,很难打开的,最好还是在线看吧