python program to break csv into multiple txt files (abandoned)
python script to break csv into multiple txt files (a byproduct of my nlp project)
Well, this all started off with my complaint:
It’s 2020 and those NLP tools still do not support csv! (。•ˇ‸ˇ•。)
Imagine that you had scraped a whole bunch of texts into a single csv file, you were happy and you’d never been more ready for corpus analysis. Then you opened AntConc
and realized the software could only take txt sources. That discovery ruined your day…
There are a number of csv-txt converters available online. But most of them either:
After a few trials of the existing tools I decided to create a converter on my own. Currently the program csv2txt.py
has the following functionality:
before: a messy csv file with texts in column I (shaded below) and metadata in columns A-H
after: each cell converted to a single txt file, which can be processed / analyzed by AntConc!