From a single draft note create a two column CSV like this?

I must say this has been the most responsive community I’ve ever seen. Thank you for all those who have helped me tremendously in providing these actions, I have nothing but gratitude towards everyone and again, let me buy you a few cups of coffee or beers to show my appreciation.

Last piece of the workflow

I exported a CSV that looks like this

As you can see, its a single column CSV with multiple lines. Once I get this exported CSV, I just found out that Drafts can import them and so I imported them into a Workspace and they now look like this in Drafts

Now the action will produce a CSV titled CDExports for the sake of naming the file.

which will remove from column A the text string that looks like this which is at the end always {{c1:: whatever text string/s are here }} and create column B with that same text string but without the

{{c1:: }}, meaning it wil remove this encoding the text string has and just paste in column B as pure text and the output CSV will like this:

It can exports the contents to a CSV file in this location “iCloud Drive/Drafts/CDExports.csv”

Triple thanks !! Cheers



:pray: :pray: :pray: with :cherries: on top, thanks

hey @crownandbridge, I’ve read through your post. Is there something you’re specifically looking for help on? It’s not clear on my end.

Thanks !!

So I have a CSV with only Column A which houses text strings that look like this:

What does an elevated serum creatinine level preoperatively increases the risk for {{c1::postoperative kidney injury}}

So, I then import that CSV file into Drafts and all these text strings look like this.

The goal is for Drafts to create a CSV via an action that moves the portion of the text strings that has the curly brackets eg. {{c1:: answer }} into column B, so basically create a new column, column B, and paste the content of the curly brackets code without the curly brackets just the actual answer.

In the about example the csv would like this:

if column A could have a “?” at the end like this all the better

if not the previous would suffice. The CSV can go into Local/Drafts/ and the output name of the file doesn’t matter whatever name is ok.


PS. in order for the script to get a lot of eyeballs and promote Drafts this will be use as follows:

Convert Anki Cloze Deletion cards into Front Back cards to import into any other Space Repetition Software.

Thanks. Follow up question for you. The format of {{c1:: answer }}, how strict is it?

  • Can c or 1 ever change to be different characters? e.g: c2 or c3 or p1
  • Can there be spaces between any of those keys? e.g {{c1 vs {{ c1 vs {{ c 1
  • Is the answer key always at the end of the sentence or could it exist anywhere in the sentence?
1 Like

Perhaps worth looking at what was discussed here.

1 Like

Thanks @motopascyyy

its strict the answer is always encased in that code {{c1:: this is the answer }}

  • it will always be {{c1:: there may be space here }}

  • it will always be c1

  • the answer key will always be at the end of the sentence


Thanks @crownandbridge. The scripting shouldn’t be too complicated but as @sylumer suggests, there’s another thread going and this is definitely something that’s solved using regular expressions. Were you able to take a look at the thread and recommendations made there?