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 to optimize the speed of processing large JSON files in Python without using too sophia2005 3 963 Aug-02-2025, 03:25 PM
Last Post: snippsat
  how to download large files faster? kucingkembar 3 2,354 Feb-20-2025, 06:57 PM
Last Post: snippsat
  Problems writing a large text file in python Vilius 4 2,033 Dec-21-2024, 09:20 AM
Last Post: Pedroski55
  Insert 10gb csv files into sql table via python mg24 2 5,751 Apr-28-2023, 04:14 PM
Last Post: snippsat
Star python exception handling handling .... with traceback mg24 3 4,444 Nov-09-2022, 07:29 PM
Last Post: Gribouillis
  Handling pdf files with python. fuzzin 1 2,283 Jan-19-2022, 02:24 PM
Last Post: ThiefOfTime
  Handling Python Fatal Error richajain1785 7 11,503 Oct-14-2021, 01:34 PM
Last Post: Tails86
  Handling large images with OpenCV. Apenz1 0 2,804 Jan-16-2021, 05:12 PM
Last Post: Apenz1
  Handling multi-input/output audio in python bor1904 4 6,187 Nov-04-2020, 08:25 AM
Last Post: CHLOVRL
  Python Requests package: Handling xml response soumyarani 1 4,042 Sep-14-2020, 11:41 AM
Last Post: buran

Forum Jump:

User Panel Messages

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