0
How to combine multiple (many) .txt files into one

Kinda self explanatory. So for a project I'm writing an RNN to generate text, and I was planning to train it with Cornell's database of congressional speeches. The DB is composed of many short text files, but for my purpose, I would like to combine all of these into one very large .txt file, and then convert it to a .csv. Is there an easy way to do this?

Thanks in advance!


Python Not Spam Edit Delete 04-02-20, 3:33 p.m. tyresebro1
0

I am assuming all the .txt files are in the same folder and distributed in different directories.

I will provide an example to read all the text from the text files https://pastebin.com/TUtQv6xj

The code in the pastebin actually creates an array of all the test from the .txt files. To save it in the CSV you may have to somehow create the labels with which the text should be associated. As you have not provided sufficient information regarding the labels in CSV, I may not be able to help you much on that.

Not Spam 05-02-20, 3:26 p.m. iakashchavan Delete Edit


0

Kinda self explanatory. So for a project I'm writing an RNN to generate text, and I was planning to train it with Cornell's database of congressional speeches. The DB is composed of many short text files, but for my purpose, I would like to combine all of these into one very large .txt file, and then convert it to a .csv. Is there an easy way to do this? fedloan fedloan easybib

issue solved!!!!

Oops! Looks like spam! Waiting for moderator approval
Spam 08-02-20, 6:49 a.m. tyresebro1 Delete Edit

Login to add comment
Oops! Looks like spam! Waiting for moderator approval


0

Kinda self explanatory. So for a project I'm writing an RNN to generate text, and I was planning to train it with Cornell's database of congressional speeches. The DB is composed of many short text files, but for my purpose, I would like to combine all of these into one very large .txt file, and then convert it to a .csv. Is there an easy way to do thi easybibs?

issue solved!!!

Oops! Looks like spam! Waiting for moderator approval
Spam 08-02-20, 6:50 a.m. tyresebro1 Delete Edit

Login to add comment
Oops! Looks like spam! Waiting for moderator approval