/Accionlabs

Python Script to process text file.

Primary LanguagePython

Accionlabs

Python Script to process text file.

Write a python script that takes input.txt as input, parses it, and produces output.txt as output.

The script should be a general script that works on any file supplied with the format of input.txt.

The script should be run like this:

cat input.txt | python text_processor.py > output.txt

[-- input.txt is below --]

  • This is an outline

. It's not a very good outline

.. I've seen better

.. I've seen worse

... I saw a really bad one back in 2008

  • This is the second numbered item in the outline

. This is sub text that spans multiple lines

This should be included with the previous line

And this line too

.. That is more sub text

  • Numbers

. Some text

** Lots

. Some more text

. And some more

*** And lots

. One

.. Two

... Three

**** Of numbers

. Another line

** Less Numbers

. Text

*** More Numbers

. Blah

  • One number again

. The last line