Is there a way to put all search findings into a folder?

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

Put search findings into a folder

Things I have tried

I am searching for a link [[patho_xyz]] I find a bunch of links that I want to put into a folder so that I can use the application Linter to make a Yaml category: Patho_ These files need to be in a folder. How can I do this easily? I have to do a similar process for many files. Please look at the screenshot of the files I want to place in a folder.

I am not aware of any build-in functionality that directly would allow you to move the found notes all in one specific folder. However, there is a way to export a list of the relative file paths (directory and name) of the found notes. That list then can modified into a script that moves each file in a folder.

The way to generate the list of found notes (files) is

  1. Click the … icon to the right of where it says x results.
  2. Select “Copy search results”
  3. In the “Copy search results” dialog, turn on “Show path”, set “Link style” to “None” and leave “List prefix” on “None”
  4. Clikc the button “Copy results” to lead the entire list in yoru clipboard.

Now paste the contents in a text file and use external text processing tools (an editor, command line tools) to turn these lines into commands for moving files that your operating system understands. In other words, you are creating a script. Run the script to automatically move the files.

For example, if the list looks like

Project/An Important Project
Area/Science and Technology

then, when on Apple iOS or Linux, one would first quote the file names to prevent spaces in file names from being interpreted as delimiters:

"Project/An Important Project"
"Area/Science and Technology"

Then at the start of the line, the mv (move) command is added, and at the end of the line the target directory, e.g. “Destination”:

mv "Project/An Important Project" Destination
mv "Area/Science and Technology" Destination

To automatically execute all generated commands, that script (assume you name it movemyfiles)is placed into the root folder of the Obsidian vault, the folder where the folders “Project” , “Area” and “Destination” in the example live. Then the system terminal is opened, and it is then important to first make the Obsidian vault the current directory. Thus, if your obsidian vault is /home/username/Obsidian/Notes, then the cd command will change into that folder, i.e., make it the default folder (directory). The second command, ls (“list”) is just a check: if that displays the name of your script, it indicates you are in the correct directory. After that, the script that is placed there is executed by sourcing it.

cd /home/username/Obsidian/Notes
ls -d movemyfiles
source movemyfiles

maybe this helps

Yes, right now I bumped onto this Youtube video about that plugin.

Are you going to move stuff back out of that folder again afterwards? Are you just going to add a single category to these files?

If so, I’m thinking out wood be easier to use something like omnisearch api or anything with a search api, and then process the results according to your needs. Either using templater, dataview or some other javascript engine of your choice.

@Vanadium,
Thank you for your excellent instructions. I really tried to follow even downloading a coding app. But honestly, the procedure is beyond me and since I am cleaning up my vault that level of complexity would be difficult to impliment. Even knowing the complexity of moving a batch of files makes me greatful to creators of helpful plugins and the people who can explain how to use them.

To my great fortune, Prakash Joshi Pax made a clear video on a plugin called File cooker. https://www.youtube.com/watch?v=AP7a4jqtudU I have yet to try it, but like all his videos, he is easy for a total novice like me to follow. I guess you have posted about this plugin elsewhere. But, I will repeat my praises of Prakash.

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