Ancestors

Written by Ken Butler on 2024-11-15 at 04:44

tonight I grabbed my simplenote notes and moved them into my obsidian vault. The problem is that they are .txt files and not .md like the ones in obsidian. So I looked at some of the .md markdown obsidian notes and saw that they are actually just plain text unless I have added any actual markdown to them.

=> More informations about this toot | More toots from nxskok@mastodon.cloud

Written by Ken Butler on 2024-11-15 at 04:46

So I figured that I would just try renaming the .txt files to .md and see whether it worked. I remembered that mv is a pain because you can't just give it a bunch of files and say "change the extension of all of these files from .txt to .md", not at least without writing a shell script that I can never remember the format for without looking it up.

=> More informations about this toot | More toots from nxskok@mastodon.cloud

Written by Ken Butler on 2024-11-15 at 04:50

Hence, #rstats and the fs package, which I had never used before. I set dir_base to be the folder I wanted to work in, and then

dir_info(dir_base) %>% 
  filter(str_detect(path, ".txt$")) %>% 
  filter(str_detect(path, "T")) %>% 
  pull(path) -> txtfiles
txtfiles

dir_info returns info about all the files in the folder you give it. Then I used stringr to select the files I wanted to rename.

=> More informations about this toot | More toots from nxskok@mastodon.cloud

Toot

Written by Josiah on 2024-11-15 at 05:03

@nxskok {fs} is so underated

=> More informations about this toot | More toots from josi@fosstodon.org

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113485216656071843
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
266.788409 milliseconds
Gemini-to-HTML Time
0.732252 milliseconds

This content has been proxied by September (ba2dc).