I have long file with the following format.

123.I am biniyam sdfjhjkhkjsfsd \n
    sdfhhkjhkjhksdfl \n
14.I am in cybersecurity \n
   fdkjskdlfnmnjhuksnfe,h \n
872.I love soccer. \n

I wanted to remove the numbers and have them in the following format.

I am biniyam sdfjhjkhkjsfsd
I am in cybersecurity
I love soccer.
  • 2
    Hi biniyam getu, you'll need to give some information about what you're stuck on rather than asking us to write the program for you. Also python programming questions are best directed to Stackoverflow.com. You might want to look into the python-docx library – Philip Couling May 14 at 14:27

Why do you need to write a python script? This is a small job for a stream editor:

sed 's/^[0-9]\{1,\}\.//;s/ \\n$//' yourfile

This would even make the question on-topic here at U&L.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.