[Tutor] Merging Text Files

Alan Gauld alan.gauld at btinternet.com
Thu Oct 14 01:15:44 CEST 2010

"Ara Kooser" <ghashsnaga at gmail.com> wrote

> I was thinking about writing the text files into a dictionary and 
> then
> searching for each ID and then insert the content from file TWO into 
> where
> the IDs match. But I am not sure how to start. Is there a more 
> pythony way
> to go about doing this?

Thats exactly how I would do it provided the data volumes fitr in 
otherwise the same technique but using a simple single table database
with SqlLite.

Depending on what you want to do with the data after merging a
database might even be the best solution since it will enable you
to perform complex queries/filters etc on the final data.

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list