readtext icon indicating copy to clipboard operation
readtext copied to clipboard

Any plans for writetext?

Open hope-data-science opened this issue 6 years ago • 2 comments
trafficstars

It's amazing that readtext could read multiple files all at once and import into R environment. Is there a way to write them all into split files? Is it possible to make a writetext function to realize it?

hope-data-science avatar Nov 09 '19 09:11 hope-data-science

Not a bad idea. What format would this take? Would it write one .txt file per document, to a specified output folder? For instance:

writetext(x, path)

where the filenames are from doc_id + txt and the contents from text?

It's already easy to write a .csv from a readtext import, since this is just a slightly special data.frame, and the document-level variables are included.

kbenoit avatar Nov 11 '19 12:11 kbenoit

I think writetext could serve for those who want to batch clean their text, I think txt and csv both might be important, while doc and docx also has their place. doc_id is a great column to write, but I think user could also specify their own character columns. This would not be hard, but I think those who need writetext might face big data and clean them and save for further analysis. No idea where it leads to so far, but I think it might help some users. For instance, I may have tons of texts and I find a typo for every text and want to correct it and save it again.

hope-data-science avatar Nov 11 '19 15:11 hope-data-science