Zettelkasten Forum


Help with modifying a KM script please?

Hi, at some point I've taken a KM script from here (don't know who posted it, apologies) that inserts a link to existing notes.

It's coming up with two suggestions for each note - I suspect it's becuase in the folder there's a plist file for every .md note, because I used another app to access the folder and that's what it generates. Annoyingly.

The script is this - can this be modified to only show the one expected entry?

ls | sed -E -e 's/.[^.]*$//' -e 's!^([0-9]+)[[:space:]-]+(.+)!\2 [[\1]]!'

If not, it's no big deal, I've only accessed this folder with the other app to prepare for my exams and it's not part of my long term ZK approach, so I'll just start afresh once I'm through - but it would be really good. Thanks in advance.

Comments

  • Do you mean like this?

    This is a result of the plist shenanigans. This should work.
    ls | sed -E -e 's/\..*$//' -e 's!^([0-9]+)[[:space:]-]+(.+)!\2 [[\1]]!' | sort -u

    Will Simpson
    I'm a Zettelnant.
    Research: Rationalism, Zen, Non-fiction Creative Writing
    kestrelcreek.com

  • @Will said:
    Do you mean like this?

    This is a result of the plist shenanigans. This should work.
    ls | sed -E -e 's/\..*$//' -e 's!^([0-9]+)[[:space:]-]+(.+)!\2 [[\1]]!' | sort -u

    That's fantastic, thank you. I'll try that tomorrow.

  • edited June 12
    sed -E -e .... *.md | sort -u
    

    :wq

Sign In or Register to comment.