You are writing a comment about Huge CSV and XML Files in Python, here is a quick summary:
Quick walkthrough of my code for converting a very large CSV file into a very large XML file using the Python standard libraries. Despite a few issues along the way, was a very pleasant experience.
You are responding to this comment written by Will Larson on January 22nd 2009, 17:47.
So.. how are you handling the non-deterministic parsing? If you have a list of headers in the first row, then you can identify the number of expected elements per row. So you know any row with more than N unescaped commas is malformed. What then?
- Just say to hell with it, and after reaching N-1 columns, force everything else into the last column.
- Do the same, but starting at the end. (Why would this be better? I don't think it would be. But I want it to be.)
-
Start from front and back. Take the first
(N/2)-1columns from the front, and the firstN/2columns from the rear, and then make everything inbetween into one column. - ?????
Please be aware that comment forms go stale after one hour.
Comments may make use of LifeFlow MarkDown. Raw html will be escaped.
Quick Introduction to LifeFlow MarkDown Syntax
A highlighted code block:
Other common languages work as well: scheme, python, java, html, etc.
Other markdown syntax: