Comments (3)
I'm closing this issue - if you have any issues with this feel free to reopen
from organize.
Yes, this can be achieved with organize. You can use a python
-filter to parse the instructions and generate the new path.
For example:
rules:
- folders: "~/Documents/"
filters:
- extension:
- pdf
- docx
- filename:
contains: "_"
- python: |
import os
parts = []
instructions = dict()
for part in path.stem.split("_"):
if part.startswith("A-"):
instructions["A"] = part[2:]
elif part.startswith("V-"):
instructions["V"] = part[2:]
elif part.startswith("content-name"):
instructions["content"] = part[12:]
else:
parts.append(part)
return {
"new_path": os.path.join(*parts),
"instructions": instructions,
}
actions:
- echo: "New path: {python.new_path}"
- echo: "Instructions: {python.instructions}"
- echo: "Value of A: {python.instructions.A}"
- move: "~/Documents/{python.new_path}/{path.name}"
from organize.
No issues at the moment. Thanks!
from organize.
Related Issues (20)
- Filenames with square brackets ignored HOT 2
- `assert` is missing in test_extension.py HOT 1
- Can't use actions, even if copied rules from documentation HOT 12
- Consistent chronological order Issue in File Renaming HOT 6
- rename action error: ERROR! Missing value for template: 'builtin_function_or_method object' has no attribute 'strftime' HOT 3
- Original Name Variable Issue in Move and Rename Operation HOT 3
- Error: Config problem HOT 4
- Integration of Third-Party Plugin Interface HOT 1
- XDG_CONFIG_HOME ignored by default on macOS HOT 2
- Include multiple actions and mix move and shell crashes organize-tool HOT 3
- Moving a file to a NAS server triggers an error HOT 10
- Have Organize start up and stay running for interaction at the command line, (rather than run a config.yml and close)? HOT 5
- Skipped files / Silent Error / Lack of verbose run HOT 7
- macos_tags problem HOT 5
- Renaming files HOT 5
- Copy folder structure from parent folder, monitored folder, or root folder HOT 4
- Persist logs HOT 1
- Remove macOS tags
- TypeError: unhashable type: 'list' when using aliases HOT 7
- Shell command fails HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from organize.