Obsidian Noter
Copy Markdown and plain text files into the Obsidian vault at ~/Obsidian-vault-01, preserving folder structure. Source files are never deleted or modified.
Settings
- •Vault path:
~/Obsidian-vault-01 - •Target folder:
90-Migrated
All migrated files are placed under the target folder inside the vault. For example, with the defaults above the destination root is ~/Obsidian-vault-01/90-Migrated/. To change the subfolder, edit the value next to "Target folder" above.
Rules
- •Only operate on Markdown and plain text files. Accepted extensions:
.md,.markdown,.txt,.text - •Skip all other file types (images, PDFs, Office documents, HTML, etc.). Report skipped files to the user.
- •Rename and reformat text files to Markdown. Any
.txtor.textfile must be renamed to.md. Review the content and ensure it uses valid Markdown formatting (headings, lists, paragraphs). Do not invent content, only adjust formatting where needed. - •Preserve the source directory as a folder in the vault. When copying a directory, use its basename (last path component) as the top-level folder in the vault, then recreate the internal hierarchy under it. For example,
/obsidian-noter ~/projects/notescreates<vault>/notes/.... - •Do not overwrite existing files. If a file with the same name already exists in the vault, ask the user how to proceed (skip, rename, or overwrite).
- •Report results. After processing, print a summary: files copied, files renamed (.txt to .md), files skipped.
Workflow
Given $ARGUMENTS as the source path:
Step 1: Validate source
- •Verify the source path exists.
- •Determine if it is a file or a directory.
Step 2: Discover files
- •If the source is a single file, process that file.
- •If the source is a directory, recursively find all files within it.
- •Classify each file as accepted (
.md,.markdown,.txt,.text) or skipped (everything else).
Step 3: Process each accepted file
For each accepted file:
- •Read the file content.
- •If the extension is
.txt,.text, or.markdown:- •Change the target extension to
.md. - •Review the content for basic Markdown formatting. Fix obvious issues (e.g., add blank lines before headings, ensure list markers are consistent). Do not alter the meaning or add new content.
- •Change the target extension to
- •Determine the target path inside the vault. The base destination is
<vault>/<target-folder>(by default~/Obsidian-vault-01/90-Migrated). Read the current "Target folder" value from the Settings section above. When the source is a directory, use its basename (the last path component) as a subfolder under the target folder. For example, if the source is~/test/folder, the target root is~/Obsidian-vault-01/90-Migrated/folder/. Preserve the internal folder structure relative to the source directory under that target root. When the source is a single file, place it directly in the target folder. - •Check if the target path already exists. If so, ask the user before proceeding.
- •Create any necessary parent directories in the vault.
- •Write the file to the target location.
Step 4: Summary
Print a summary table:
code
Copied: X files Renamed: Y files (.txt/.text/.markdown -> .md) Skipped: Z files (list filenames)