こんにちは私は単純なgraphMLファイルを持っています。ノードタグをGraphMLから削除し、別のGraphMLファイルに保存したいと思います。 GraphMLのサイズはサンプルが3GB以下です。GraphMLファイルを別のものに変換する
入力ファイル:
<?xml version="1.0" ?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd">
<key id="weight" for="edge" attr.name="weight" attr.type="string"></key>
<graph id="G" edgedefault="directed">
<node id="1"></node>
<node id="2">
</node>
<node id="3">
</node>
<node id="4">
</node>
<node id="5">
</node>
<edge id="6" source="1" target="2">
<data key="weight">3</data>
</edge>
<edge id="7" source="2" target="4">
<data key="weight">1</data>
</edge>
<edge id="8" source="2" target="3">
<data key="weight">9</data>
</edge>
</graph>
</graphml>
必要な出力:
<?xml version="1.0" ?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd">
<key id="weight" for="edge" attr.name="weight" attr.type="string"></key>
<graph id="G" edgedefault="directed">
<edge id="6" source="1" target="2">
<data key="weight">3</data>
</edge>
<edge id="7" source="2" target="4">
<data key="weight">1</data>
</edge>
<edge id="8" source="2" target="3">
<data key="weight">9</data>
</edge>
</graph>
</graphml>
は、これを行うための任意の方法はありますか?
実は、問題はファイルサイズです。私は[xml.etree.ElementTree](https://docs.python.org/3.4/library/xml.etree.elementtree.html#module-xml.etree.ElementTree)のpythonライブラリを使って同じタスクを実行しました。 – arjun045