Search code examples
pythonregexexcelpycharmfile-writing

How to write a paragraph to an excel file, each word in new cell?


I have a corpus of around "1 million Urdu sentences" in a .txt file (notepad). I want to save each "Urdu word" in a separate cell of an excel sheet.

Can some one help me with any regex or code fragment tested? I am using python pycharm. I don't know if it can be done through some easy way or trick or using some other tool?


Solution

  • My first thought is to import the file using Excel directly. Data --> From Text, and then separate the words using " " or whatever delimiter is used between words