[Tutor] How to parse large files

Steven D'Aprano steve at pearwood.info
Tue Oct 27 18:57:23 EDT 2015


On Tue, Oct 27, 2015 at 10:32:51PM +0100, jarod_v6--- via Tutor wrote:
> Hi!
> I want to reads two files and create simple  dictionary.  Input file contain more than 10000 rows

Since you are talking about a tab-delimited CSV file, you should use the 
csv module:

https://pymotw.com/2/csv/

https://docs.python.org/2/library/csv.html

Unfortunately the version 2 csv module doesn't deal with non-ASCII 
characters very well, but the Python 3 version does:

https://docs.python.org/3/library/csv.html


-- 
Steve


More information about the Tutor mailing list