Python Forum
Handling Large XML Files (>10GB) in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handling Large XML Files (>10GB) in Python
#1
Parsing Big XML Files
Need help to parse very large xml files(>10GB). Could you please help how to avoid memory issues. We can't read the entire file once. Any code example or conceptual explanation please. Thanks
Reply
#2
Use lxml and iterparse. When you've finished with an element you will need to use clear to prevent a buildup in memory.
This should let you open an XML file of most any size.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I improve the performance of a Python script that processes large amounts of molybdenumproducts1122 2 95 Sep-18-2026, 10:19 PM
Last Post: bowlofred
  How to optimize the speed of processing large JSON files in Python without using too sophia2005 3 996 Aug-02-2025, 03:25 PM
Last Post: snippsat
  how to download large files faster? kucingkembar 3 2,414 Feb-20-2025, 06:57 PM
Last Post: snippsat
  Problems writing a large text file in python Vilius 4 2,072 Dec-21-2024, 09:20 AM
Last Post: Pedroski55
  Insert 10gb csv files into sql table via python mg24 2 5,782 Apr-28-2023, 04:14 PM
Last Post: snippsat
Star python exception handling handling .... with traceback mg24 3 4,481 Nov-09-2022, 07:29 PM
Last Post: Gribouillis
  Handling pdf files with python. fuzzin 1 2,303 Jan-19-2022, 02:24 PM
Last Post: ThiefOfTime
  Handling Python Fatal Error richajain1785 7 11,583 Oct-14-2021, 01:34 PM
Last Post: Tails86
  Handling large images with OpenCV. Apenz1 0 2,819 Jan-16-2021, 05:12 PM
Last Post: Apenz1
  Handling multi-input/output audio in python bor1904 4 6,226 Nov-04-2020, 08:25 AM
Last Post: CHLOVRL

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020