User Tools

Site Tools


functions:functions_list

Functions



Functions can only be used in the “Populate Variables” Processor. Using Functions you can manipulate strings or numbers, do calculations, read files, parse JSON and much more. The execution of a function typically takes < 1ms, so it is about executing quick actions that are not worth inserting a processor into your workflow.

Usage description:

 $function(input-1 = "string", input-2 = integer[, optional input-3 = "string"/integer])


  • ALL string inputs containing alphabetic characters (a-z, A-Z) must be encapsulated with single or double quotes: “my string”, '123abc', “%s_variable%”, '%i_variable%'.
  • Functions that accept numbers do not need to be encapsulated with quotes.
  • If numeric character(s) (0-9) are used in functions that accept strings then the number will be treated as a string: 123 = “123”
  • All functions can be nested (functions within functions):$replace($left(“my strings”, 6), “my”, “your”) = “your str”
  • Nested function must NOT be encapsulated with quotes.See Nested Functions

Character String Functions

$left()Get string n-characters from the left side.
$triml()Trim string n-characters from the left side.
$right()Get string n-characters from the right side.
$trimr()Trim string n-characters from the right side.
$middle()Get string n-characters from n-position.
$between()Get string between two strings.
$upper()Force string to upper case.
$lower()Force string to lower case.
$proper()Capitalizes every first letter following a non-alphanumeric character.
$replace()Replace string in string.
$regreplace()Replace string in string by regex pattern.
$alrep()Replace all non-alphanumeric characters and add optional exceptions.
$leads()Add leading character(s) to a string. If string to fill is omitted a zero (0) will be used.
$trails()Add trailing character(s) to a string. If fill-string is omitted a zero (0) will be used.
$stripws()Removes leading and trailing white spaces.
$stripcrlf()Strips string for line feed and carriage returns.
$isdigit()Check if string is only numbers. Success returns 1, failure returns 0.
$isalpha()Check if string is only alphabetic letters. Success returns 1, failure returns 0.
$length()Retrieves length of the string (number of characters).
$reverse()Reverse a string.

Mathematics Functions

$round()Round number to nearest decimal.
$roundd()Round number down to nearest integer.
$roundu()Round number up to nearest integer.
$inttotc()Convert integer to time code.
$tctosec()Convert time code to seconds.
$abs()Returns the absolute value of a number.
$log()Returns the natural logarithm of a number.
$random()Returns a random integer number between two integers.

Other Functions

$exists()This is a file function that will tell if file(s) exists.
$base64()Encodes the input string as base 64.
$base64dec()Encodes the input UTF-8 string as terminated base64 string.
$jsonencode()Converts the input string to an JSON friendly string.
$jsonget()Retrieves the value from a JSON object key. Here is an example to retrieve values from ffprobe
$jsonput()Puts a value to a JSON object.
$readarray()Returns an instance from a valid array; “[data, data, etc…]”.
$regext()This is regular expression function. It extracts text based on recognition patterns.
$hex()Converts a decimal integer to hexadecimal number.
$dec()Converts a hexadecimal number to decimal integer.
$guid()Returns a random GUID/UUID.
$xxhash()Returns an eight character hash for any file.
$read()Reads the contents of a any text file.
$urlencode()Converts the input string to an URL friendly string.
$week()Returns the week number from the date specified in the parameters. If no date is specified, the function returns the current week number.
$weekday()Returns the week day number from the date specified in the parameters. If no date is specified, the function returns the current week day number.

                                                                                                          Back to top

functions/functions_list.txt · Last modified: 2021/06/13 21:19 by steinar