Skip to content

Filters

Fabio Mucciante edited this page Jul 18, 2022 · 5 revisions

Logically filters are split into four different areas, depending on how the target to operate on is interpreted by the filter itself:

  • some of them consider a string just a list of words;
  • others interact with only numbers or occurrences;
  • it might be a collection of substrings created with a regular expression;
  • last but not least a miscellanea group of filters that might have different use cases.

Word filters

--append-as-word-to TEXT,TARGET
Append the TEXT to TARGET as a word
input: images/image 20191224081015.jpeg

params:
  TEXT: summer
  TARGET: folder
 
output: images summer/image 20191224081015.jpeg
--append-word-from NTH,TARGET
Append the NTH word from TARGET to the current target
input: summer images/image 20191224081015.jpeg

params:
  NTH: 1
  TARGET: folder

output: summer images/image 20191224081015 summer.jpeg
--append-word-to NTH,TARGET
Append the NTH word from the current target to the destination TARGET
input: summer/image 20191224081015.jpeg

params:
  NTH: 1
  TARGET: folder

output: summer image/image 20191224081015.jpeg
--append-to-word NTH,TEXT
Append the given TEXT to the NTH word in the current target
input: summer/image 20191224081015.jpeg

params:
  NTH: 1
  TEXT: -outdoor

output: summer/image-outdoor 20191224081015.jpeg
--capitalize
Capitalize each word in the current target
input: Summer/IMAGE AQUAPARK 20191224081015.jpeg

params:

output: Summer/Image Aquapark 20191224081015.jpeg
--capitalize-word NTH
Capitalize the NTH word in the current target
input: summer/image aquapark 20191224081015.jpeg

params:
  NTH: 2

output: summer/image Aquapark 20191224081015.jpeg
--copy-word NTH1,NTH2
Copy the NTH1 word to the NTH2 place
input: images/image aquapark summer 20191224081015.jpeg

params:
  NTH1: 1
  NTH2: 3

output: images/image aquapark image 20191224081015.jpeg
--delete-word NTH
Remove the NTH word
input: images/image aquapark summer 20191224081015.jpeg

params:
  NTH: 1

output: images/aquapark image 20191224081015.jpeg
--insert-after-word NTH,WORD
Insert the WORD after the NTH word
input: images/image aquapark 20191224081015.jpeg

params:
  NTH: 1
  WORD: summer

output: images/image aquapark summer 20191224081015.jpeg
--insert-before-word NTH,WORD
Insert the WORD after the NTH word
input: images/summer 20191224081015.jpeg

params:
  NTH: 1
  WORD: aquapark

output: images/aquapark summer 20191224081015.jpeg
--join-words NTH1,NTH2,NTH3
Join the words NTH1 and NTH2 and replace NTH3 with it
input: images/aquapark summer 20191224081015.jpeg

params:
  NTH1: 1
  NTH2: 2
  NTH3: 2

output: images/aquaparksummer 20191224081015.jpeg
--lowercase
Lowercase each word
input: images/AQUAPARK SUMMER 20191224081015.jpeg

params:

output: images/aquapark summer 20191224081015.jpeg
--lowercase-word NTH
Lowercase the NTH word
input: images/AQUAPARK SUMMER 20191224081015.jpeg

params:
  NTH: 2

output: images/AQUAPARK summer 20191224081015.jpeg
--move-word NTH1,NTH2
Move the NTH1 word to the NTH2 place
input: images/image aquapark summer 20191224081015.jpeg

params:
  NTH1: 1
  NTH2: 3

output: images/aquapark image 20191224081015.jpeg
--move-word-to NTH,TARGET
Move the NTH word to TARGET
input: images/image aquapark summer 20191224081015.jpeg
targets:
  tmp: 

params:
  NTH: 1
  TARGET: tmp

output: images/aquapark summer 20191224081015.jpeg
targets:
  tmp: image
--prepend-to-word NTH,TEXT
Prepend the TEXT to the NTH word
input: images/aquapark summer 20191224081015.jpeg

params:
  NTH: 2
  TEXT: early-

output: images/aquapark early-summer 20191224081015.jpeg
--prepend-word-from NTH,TARGET
Prepend the NTH word with the content of TARGET
input: images/aquapark summer 20191224081015.jpeg
targets:
  tmp: early

params:
  NTH: 2
  TARGET: tmp

output: images/early aquapark summer 20191224081015.jpeg
--replace-word NTH,TEXT
Replace the NTH word with TEXT
input: images/image aquapark summer 20191224081015.jpeg
targets:
  tmp: early

params:
  NTH: 1
  TEXT: travel to

output: images/travel to aquapark summer 20191224081015.jpeg
--split-word NTH,REGEX
Split the NTH word using a REGEX with capturing groups
input: images/image aquaparksummer 20191224081015.jpeg

params:
  NTH: 2
  REGEX: "(a.*k)(s.*)"

output: images/image aquapark summer 20191224081015.jpeg
--swap-word NTH1,NTH2
Swap the NTH1 word with the NTH2
input: images/image aquapark summer 20191224081015.jpeg

params:
  NTH1: 1
  NTH2: 3

output: images/summer aquapark image 20191224081015.jpeg
--uppercase
Uppercase each word
input: images/image aquapark summer 20191224081015.jpeg

params:

output: images/IMAGE AQUAPARK SUMMER 20191224081015.jpeg
--uppercase-word NTH
Uppercase the NTH word
input: images/image aquaparksummer 20191224081015.jpeg

params:
  NTH: 2

output: images/image AQUAPARK summer 20191224081015.jpeg
--wrap-words NTH,SEPARATOR1,SEPARATOR2
Wrap the NTH words with SEPARATOR1 and SEPARATOR2
input: images/image aquapark summer 20191224081015.jpeg

params:
  NTH: 3
  SEPARATOR1: (
  SEPARATOR2: )

output: images/image aquapark (summer) 20191224081015.jpeg

Number filters

--add-number NTH,NUM
Add NUM to the NTH number
input: images/aquapark summer 2022 #10.jpeg

params:
  NTH: 2
  NUM: 15

output: images/aquapark summer 2022 #25.jpeg
--add-number-from NTH;TARGET
Add the number from TARGET to the NTH
input: images/aquapark summer 2022 #10.jpeg
targets
  tmp: 22

params:
  NTH: 2
  TARGET: tmp 

output: images/aquapark summer 2022 #32.jpeg
--append-number-to NTH,TARGET
Append the NTH number to TARGET
input: images/aquapark summer 2022 #10.jpeg
targets
  tmp: 

params:
  NTH: 2
  TARGET: tmp

output: images/aquapark summer 2022 #10.jpeg
targets:
  tmp: 10
--append-to-number NTH,TEXT
Append the TEXT to the NTH number
input: images/aquapark summer 2022 #10.jpeg

params:
  NTH: 1
  TEXT: -1

output: images/aquapark summer 2022 #10-1.jpeg
--copy-number-to NTH,TARGET
Copy the NTH number to TARGET
--delete-number NTH
Remove the NTH number
input: images/aquapark summer 2022 #10.jpeg

params:
  NTH: 1

output: images/aquapark summer 2022 #.jpeg
--format-number NTH,LENGTH
Format the NTH number adding leading zeroes to have LENGTH
input: images/aquapark summer 2022 #10.jpeg

params:
  NTH: 1
  LENGTH: 4

output: images/aquapark summer 2022 #0010.jpeg
--move-number-to NTH,TARGET
Move the NTH number to TARGET
--multiply-number NTH,NUM
Multiply the NTH number with NUM
--prepend-to-number NTH,TEXT
Prepend the TEXT to the NTH number
--replace-number NTH,NUMBER
Replace the NTH number with NUMBER
--swap-number NTH1,NTH2
Swap the NTH1 number with the NTH2

Regexp filters

--copy-to REGEX,TARGET
Copy the text selected by REGEX to TARGET or a numbered TARGET_n
--delete REGEX
Remove the text matching REGEX
--move-to REGEX,TARGET
Move the text selected by REGEX to TARGET or TARGET_n
--replace REGEX,REPLACE
Replace the text matching REGEX with REPLACE
--replace-from REGEX,TARGET
Replace the REGEX matching text with the TARGET content
--set-when REGEX,TEXT[,TARGET]
Set the current or given TARGET to TEXT when REGEX is matched

Occurrence filters

--copy-occurrence-to NTH,REGEX,TARGET
Copy the NTH occurrence of REGEX to TARGET
--delete-occurrence NTH,REGEXP
Delete the NTH occurrence of REGEXP
--move-occurrence-to NTH,REGEX,TARGET
Move the NTH occurrence of REGEX to TARGET overwriting it
--replace-occurrence NTH,REGEXP,TEXT
Replace the NTH occurrence of REGEXP with TEXT

Miscellanea filters

--macro MACRO1,[MACRO2,...]
Apply the MACRO
--append TEXT
Append the TEXT to the current target
--append-from TARGET
Append the text from TARGET
--append-to TEXT,TARGET
Append the TEXT to TARGET
--config PARAM:VALUE[,PARAMS2:VALUE2,...]
Set config PARAM to VALUE
--copy-from TARGET
Copy the text from TARGET
--left-justify N,CHAR
Add enough CHAR(s) to the right side to have a N-length string
--prepend TEXT
Prepend the current target with TEXT
--prepend-from TARGET
Prepend the current target with the text from TARGET
--replace-date FORMATSRC,FORMATDEST[,LANG]
Replace a date from FORMATSRC to FORMATDEST (placeholders: <lt;m>, <lt;B>, <lt;b>, <lt;Y>, <lt;d>)
--reverse
Reverse the string
--right-justify N,CHAR
Apply enough CHAR(s) to the left side to have a N-length string
--select name|ext|folder|...
Select the target where apply further transformations
--set TEXT[,TARGET]
Set the current or an optional TARGET with TEXT
--spacify CHAR1,CHAR2,...
Replace CHAR with a space
--squeeze CHAR
Squeeze consecutive CHARS in only one
--template TEMPLATE
Replace the in TEMPLATE with the relative targets
--translate-words GROUP,SUBGRPS,SUBGRPD
Replace words in GROUP from SUBGRPS to SUBGRPD
--trim
Remove trailing spaces
--wrap REGEX,SEPARATOR1,SEPARATOR2
Wrap the text matching REGEX with SEPARATOR1 and SEPARATOR2
Clone this wiki locally