Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Newbie seeks help with a simple workflow
-
I have lots of text like that below. The first line at the top of the paragraphs contain a percentage and a colon (eg 16.7%:). Below it appears at the left side of the text (I don't know why it does this) but it is in fact at the top of each paragraph. So assume the [figure %:] is at the top of the text.
I want a workflow that removes it (the percentage and colon). See example below.
Text before workflow processing
16.7%:
This view is no longer tenable against the background of the increased awareness of investors of the implications of bid situations96.7%:
This Rule shall not apply in a caseText after workflow processing
This view is no longer tenable against the background of the increased awareness of investors of the implications of bid situations
This Rule shall not apply in a case
-
In Pythonista, you can express the solution as:
with open('the_text.txt') as in_file: for line in in_file: print(line.partition('%: ')[2] or line)
Hopefully that will help you to create an Editorial workflow.
-
Dear CCC
Thank you for this. I really have no clue about how to implement your solution. I was hoping for a workflow kindly to be created for me which I could then install. Is this possible? -
Try http://www.editorial-workflows.com/workflow/5804196926324736/PaaF2slTo0U
This my very first Editorial workflow ever but it is simple enough that it seems to work.
Put your text in a local file called
in_file.txt
, run the workflow, and the results will be stored in a local file calledout_file.txt
. -
I updated the workflow to work on the current text document instead of separate
in_file.txt
andout_file.txt
files. -
I believe a simple find and replace using regular expressions will work. Simple workflow. I will put it together to see if it is what you want.
http://www.editorial-workflows.com/workflow/6696332232228864/GysCUfRsoBg
It world on the currently loaded file.
-
Thank you to CCC and Tutorial Doctor for their solutions which each worked perfectly. I am really grateful.
Tunde