Cleaning up unwanted strings

Things I have tried

Simple search and replace only works within a single file.

What I’m trying to do

Imported text files have unwanted strings, like these:
[ ]{.Apple-converted-space}
(with a varying number of spaces between [ and ] )
and these:
[]{.s1}
which are sometimes wrapped around strings that I want to keep:
[INSERT DATA {]{.s1} (should read INSERT DATA {)

I don’t know why these strings appeared because they weren’t evident in the original files, but I’d like to know whether there is a way to clean these up. I don’t really want to individually visit over 1000 documents if I can avoid it.

Thanks for any guidance.

Ian.

This is not a solution using Obsidian, but I found that Visual Studio Code’s Search & Replace functionality is pretty versatile and might do exactly what you need (make backups!):

  1. Open folder in vs code
  2. Open Search in Sidebar
  3. Search for your pattern (you’d probably want a search with regex?)
  4. Press the little arrow to show the replace dialogue
  5. Enter your replacement (which is probably nothing, so leave it empty)
  6. You’ll be able to see what it is going to do in the search results below
  7. Press the replace all button and wait until it is finished

That is useful, thanks. I realised after reading your reply that I could also do this in BBEdit.

1 Like

Great that it helped. That’ll work, too.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.