0

I am using a tool called organize in order to sort folders with a lot of stuff in them and was wondering if it was possible to tell it to create, sort, or rename using ISO 8601 date format.

The config file goes like this:

rules:
    - folders: *private
      subfolders: true
      filters:
          - extension: pdf
          - created
      actions:
          - echo: "Found PDF!"
          - move: /run/media/[REDACTED]/Documents/unsorted_pdfs/{created.year}{created.month}{created.day}/

The folders it creates, is named like this: 201781; I, however, want it named like this: 20170801. Is this possible?

1 Answer 1

0

Apparently, this is not related to YAML but to organize itself. Under the 'Advanced Usage' section it says: "Note the format syntax for {created.month} to make sure the month is prepended with a zero.". This means that if you want to prepend a zero to the date, you would have to make the config like this:

rules:
    - folders: *private
      subfolders: true
      filters:
          - extension: pdf
          - created
      actions:
          - echo: "Found PDF!"
          - move: /run/media/[REDACTED]/Documents/unsorted_pdfs/{created.year}{created.month:02}{created.day:02}/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.