Re: Write Multiple Text Files into a Single CSV File

2014-12-31 Thread Scot Hacker
On Tuesday, December 30, 2014 9:54:10 PM UTC-8, Martin Mirero wrote: > > Hi folks, > > I'm just cutting my teeth on Python/Django and need some assistance on > something I've been grappling with for a few days: > >- I have a bunch of text files on disk that all have the same basic >form

Re: Write Multiple Text Files into a Single CSV File

2014-12-31 Thread Vijay Khemlani
I'm not too sure about the format of the content, but maybe this to create the file? import csv files = ['f1.txt', 'f2.txt', 'f3.txt'] with open('output.csv', 'wb') as f: writer = csv.writer(f) for input_file_name in files: with open(input_file_name, 'r') as input_file:

Write Multiple Text Files into a Single CSV File

2014-12-31 Thread Martin Mirero
Hi folks, I'm just cutting my teeth on Python/Django and need some assistance on something I've been grappling with for a few days: - I have a bunch of text files on disk that all have the same basic format: first line is the *title* and the rest is the *body* - I want to create one CS