Tuesday, December 30, 2014

Write Multiple Text Files into a Single CSV File

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 CSV file with the first column being populated from the first line of each text file (title) and the second column being populated from the rest of the text file contents (body)
  • Once I have the CSV file, I'm good to import that into my django model
Any help would be much appreciated.

Cheers.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/07a9375c-4b05-42cc-a46e-0337ce96d6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment