# Global Options

Here you find options that are used by most functions.

- Include Filter
- Optional filter that can include or exclude certain line. Read more below.

- Pre-Processor - Advanced users can use this optional filter to pinpoint what sections of the lines to be affected by processing functions. Read more below.

- Process Empty Lines - Depending on the situation, you may or may not want to process empty lines. Lines that contain only spaces or tabs are treated as empty lines as well.

- Setup Counter - This is where you setup the `<counter>` tag. Read more below.

- Define Parts - This is where you setup the `<%1>` to `<%9>` tags. Read more about parts here.

# Counter Setup

This is where you decide what your counter should look like, either when using the "Add Counter" function above, or when using the `<counter>` tag in another function.

Click on the "link" to open the Setup Counter window:

- Start Value - Select the initial value that the sequence will have. Usually 0 or 1.
  - Running counter - If you enable this the start value will automatically be updated after each operation. The new value will be the number that would have been next in line if the counter had continued the process.
  - Reset at - Once the counter passes this number it will be reset to the "start value". (Does not work together with Running counter.)
- Step - Usually each number in the sequence is increased by 1, but this can be changed by modofying this value.
- Zero Padding - It can often be useful to add zeros to the beginning of the numbers. The number you enter here is the number of digits you want the final numbers to have. For example 3 digits would result in "001", "010" and "100". Set zero padding to 0 if you don't want any zeros.
  - Auto - This will cause the program to automatically add the necessary amount of zeros to the numbers. I recommend using this.

# Include Filter

The include filter tests each line before renaming, to determine if it is to be included or not. This allows you to process only some lines, based on very specific rules:

- First line / Last line - You can limit what line numbers to process by setting these. This can be useful if for example the first line of a file contains a header that you do not want to process.

- Include only lines matching / containing - This is where the magic occurs. The string you enter here is tested against each line to see if they match. Only matching lines will be included.

  If you only enter a normal string (eg "hello") then lines that contain this string are matched. You can also enter a wildcard string (eg "hello*") for more advanced matches. The following wildcards are allowed:

  - `*` matches zero or more characters.
  - `:` matches one or more characters.
  - `?` matches exactly one character.
- Regular Expression - Regular Expressions allows for very advanced matchings. Read more about Regular Expressions here. Note that when using RegExp you can no longer use the ordinary wildcards.

- Exclude lines matching / contaning - This is the oppositve of the include filter above. You can run it alone or together with the include filter. If run together, it is applied after the include filter, so you can tell the program to first include a certain set of lines, and then from this set exclude some of the lines.

  Note: When you create presets, the include filters are saved together with each preset item. Different items can have different include filters. The line is tested for inclusion at the moment that item is running. Preset items running before can thus modify the line in a way the the include filter in the next preset item reacts upon. You can override this behaviour by using the option below the preset list at the "run preset" page.

  # Pre-Processor

  The pre-processor filters out a section of the line. Only this section is then sent to actual processing function. This way you can pinpoint what parts of the lines to process! Here is an example:

  Say that we have a string: `Replace Genius is fantastic!`. We feel strongly about this statement, so we want to scream it out in capital letters! But Replace Genius is a name, so it should still be in title case. Problem is that the set letter casing function always processes the whole line. The solution is to tell the pre-processor to skip the first 15 characters in the line so that only `is fantastic!` is sent to the casing function. The result would be `Replace Genius IS FANTASTIC!`.
  All options you see below are processed from top to bottom. So if one options alters a line, the next option will get this processed line instead of the original.

- Offset beginning - This allows you skip part of the beginning of the line.
  - Skip the first n characters - Skips the first n number of letters in the line. If n is larger than the total number of letters in the line, it will not be processed at all.

  - Skip until string is found - The program will search for the string you enter. If it is found, everything up until this string begins is skipped. If it is not found, the whole line is skipped, meaning it will not be processed at all.
- Limit length - This allows you to skip part of the end of the line.
  - Include up to n characters - Only n number of characters will be processed. After n characters have been included, the rest of the line is skipped. If n is larger than the remaining number of characters, all are included.

  - Cut if string is found - This will make the program search for a certain string. If it is found, the part of the line after that will be skipped. If it is not found, everything is included.
- Advanced filter - This allows you to match a specific section of the line using wildcards. Only this section is kept. For example, searching for `is*` in `Replace Genius is fantastic!` will find `is fantastic!`. The following wildcards are allowed:

  - `*` matches zero or more characters.
  - `:` matches one or more characters.
  - `?` matches exactly one character.

  - Regular Expression - Regular Expressions allows for very advanced matchings. Read more about RegExp here. Note that when using RegExp you can no longer use the ordinary wildcards.

  Notes:

  - The processing function will only see the section you filter out using the pre-processor. So if you for example skip a bit of the beginning of the line using the pre-processor, and then use the add function to add something to the beginning of the line, this will be added at the beginning of the processed section, which is actually located in the middle of the line. Everything is completely logical, but it can be tricky to foresee the exact results if you don't think things through.

  - When you create presets, the pre-processor is saved together with each preset item. Different items can have different include filters. You can override this behaviour by using the option below the preset list at the "run preset" page.