TextConverter

Placeholders

Placeholders are constants that can be used in the TextConverter, which stand for a certain content depending on the context. For example, the placeholder or constant %date% stands for the current date, %num% for the number or position of the file in the file list or %name% for the name of the current file. With this function it is possible, for example, to save several files under an ongoing numbering or to write file information such as the file path, the file size or the creation date directly into a file at a specific position.

At the moment, the following placeholders from the following categories are available in the TextConverter:

A list of all available placeholders can also be found in the program under "Actions > Options > Placeholders > Show Placeholders". Here you can also copy the placeholder directly into the clipboard by double clicking on one of the placeholders.

In addition to the placeholders introduced here, there are also references as a special type of placeholder available in the TextConverter. Using references, entire texts or arbitrary parts of texts can be inserted into the actions of the TextConverter using corresponding placeholders. You can find out more about this in the introduction to using references in the TextConverter.

Use and Deactivate Placeholders

If you activate the option "Actions > Options > Placeholders" on the right side of the main window, you can use the placeholder listed on this page within all actions in all text fields. The placeholders can also be used directly in the texts and text files to be processed, some placeholders can also be used in the storage options, for example within the new name or the new folder for the processed file. Basically, the placeholders can be combined with any other characters and of course you can also use one placeholder several times in the same field or combine it with other placeholders.

If the placeholder function is active, all of the placeholders are replaced by what they stand for, depending on your settings, before or after processing the files. If the placeholder function is not activated, the placeholders remain as they are in the text and will not be replaced. This makes sense, for example, if there are placeholders as such in your texts. Placeholders within file names are always active and are replaced by their content even when the option is switched off.

References can be activated and deactivated the same way via the option "Actions > Options > References".

File Name and Folder

Placeholders holding the name and path of the file.

%filepath%Path of the file with file name - for example "C:\folder\file.txt"
%path%Path of the file without file name - for example "C:\folder\"
%filename%Name of the file with file extension - for example "file.txt"
%name%Name of the file without file extension - for example "file"
%name,x,y%Name of the file from character x to character y - for example, %name,1,3% corresponds to the first three characters of the file name, %name,2,5% corresponds to the second through fifth character.
%name,wordX%
%name,wordexX%
Xth word from the name of the file - Negative values of X count the words from behind. With %name,wordX%, only spaces are used as a separator between individual words, with %name,wordexX% in addition to spaces also hyphens, underscores, points and commas.
If a file has, for example, the file name "ab cd ef.txt", %name,word1% and %name,word-3% correspond to the word "ab", %name,word2% and %name,word-2% are the word "cd" and %name,word3% as well as %name,word-1% are the word "ef". For the file name "ab-cd-ef.txt", %name,word1% would be the entire file name "ab-cd-ef", since the file name does not contain any spaces. Apart from that, for %name,wordex1% it would also be "ab" for this file name.
%ext%Extension of the file - for example "txt"
%ext,x,y%Extension of the file from character x to character y
%folderX%
%folder‑X%
Name of the Xth folder from the path of the file - The placeholders %folder1%, %folder2%, %folder3% up to %folder50% as well as %folder-1%, %folder-2%, %folder-3% up to %folder-50% are standing for the names of the folders in which the file is stored. Positive numbers like in %folder1% count the folders from the drive to the file, negative numbers like in %folder-1% count the other way around. Accordingly, the placeholder %folder1% is standing for the first folder of the path, %folder-1% is standing for the first folder below the file. When having the file C:\Holidays\Trips\Norway\File.txt %folder1% will be replaced with "Holidays", %folder-1% with "Norway", when renaming the file. Correspondingly, the placeholder %folder2% is standing for the second folder in the path, this is "Trips" in that case (%folder-2% would be the same, counted from the top).
%folderX,Y,Z%
%folder‑X,Y,Z%
Characters Y to Z from the Xth folder from the path of the file - The placeholders %folderX,Y,Z% as well as %folder-X,Y,Z% work similarly to the placeholders %folderX% and %folder-X% described above. However, only the characters Y to Z are taken from the name of the Xth folder of the file path (counted from below respectively above).
%folderX,wordY%
%folderX,wordexY%
Word number Y from the folder number X from the path of the file - negative values of X or Y count the folders respectively the words from behind. With %folderX,wordY% only spaces are treated as separator between individual words, with %folderX,wordexY% in addition to spaces also hyphens, underscores, dots and commas. The counting of the folders works like described for the placeholders %folderX% and %folder-X%. The counting of the words like described for the placeholders %name,wordX% and %name,wordexX%.
The placeholder %folder1,word1%, for example, stands for the first word of the first folder out of the path, %folder-1,word-1% stands for the last word of the last folder from the path and %folder3,word-2% stands for the penultimate word from the third folder of the path.
%drive%Drive of the file - for example "C:"

File Size

Placeholders for the size of the file.

%size%File size in a unit suitable for the file size
%size-b%File size in bytes
%size-kb%File size in kilo bytes without decimal places
%size-kb-X%File size in kilo bytes with X decimal places
%size-mb%File size in mega bytes without decimal places
%size-mb-X%File size in mega bytes with X decimal places
%size-gb%File size in giga bytes without decimal places
%size-gb-X%File size in giga bytes with X decimal places
%size-tb%File size in tera bytes without decimal places
%size-tb-X%File size in tera bytes with X decimal places

Numbering and Number of Files

Placeholders allowing a numbering of files according to their position in the file list.

%num%Number / Position of File within the list; the initial value, the increment and the number of leading zeros can be adjusted in the settings
%0num%Number / Position within the list with one leading zero (for example 01)
%00num%Number / Position within the list with two leading zeros (for example 001)
%000num%Number / Position within the list with three leading zeros (for example 0001)
%0000num%Number / Position within the list with four leading zeros (for example 00001)
%00000num%Number / Position within the list with five leading zeros (for example 000001)
%0...0num%Number / Position within the list with any number of leading zeros
%abs0num%Number / Position within the list with a number of leading zeros fitting to the total number of files in the list (1 to 9 for up to 10 files; 01 to 99 for 10 to 99 files; 001 to 999 for 100 to 999 files and so on)
%abs%Absolute Number of Files that are currently in the list
%part_num%Number of the part of a separated file. This placeholder is only available when using the action "Files > Split Files". More about this placeholder in the section "Placeholders for the Numbering of the Parts".
%part_abs%Total number of parts of a separated file. This placeholder is only available when using the action "Files > Split Files". More about this placeholder in the section "Placeholders for the Numbering of the Parts".

Numbering within Files

In contrast to the placeholders from the last section, which relate to the number respectively the position of a file in the file list, the following placeholders can be used for continuous numbering within one or more files. If one of these placeholder is replaced by a number several times per one text or one text file, with each replacement of the placeholder, it is counted up. The difference between the placeholders ending with f and those ending with fa is, that for the f-placeholders, the counter is reset with each new file, while for the fa-placeholders, the counter is not reset and thus it is continuously counted up also over several files.

%numf%Consecutive numbering within one file
%0numf%Consecutive numbering within one file with one leading zero (for example 01)
%00numf%Consecutive numbering within one file with two leading zeros (for example 001)
%0...0numf%Consecutive numbering within one file with any number of leading zeros
%numfa%Consecutive numbering through all files
%0numfa%Consecutive numbering through all files with one leading zero (for example 01)
%00numfa%Consecutive numbering through all files with two leading zeros (for example 001)
%0...0numfa%Consecutive numbering through all files with any number of leading zeros

Current Date and Time

Placeholders referring to the current date and time.

%date%Current date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy%-%mm%-%dd%)
%dd.mm.yyyy%Current date in the format "day.month.year" (two or four digits with leading zeros if necessary; short form for %dd%.%mm%.%yyyy%)
%yyyy-mm-dd%Current date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy%-%mm%-%dd%)
%time%Current time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh%-%ii%-%ss%)
%hh-mm-ss%Current time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh%-%ii%-%ss%)
%hh-mm%Current time in the format "hour-minute" (two digits with leading zeros if necessary; short form for %hh%-%ii%)
%yyyy%Current Year written with four digits
%yy%Current Year written with two digits
%mm%Current Month, always two digits, leading zeros if necessary
%m%Current Month, one or two digits without leading zeros
%dd%Current Day, always two digits, leading zeros if necessary
%d%Current Day, one or two digits without leading zeros
%hh%Current Hour, always two digits, leading zeros if necessary
%h%Current Hour, one or two digits without leading zeros
%ii%Current Minute, always two digits, leading zeros if necessary
%i%Current Minute, one or two digits without leading zeros
%ss%Current Second, always two digits, leading zeros if necessary
%s%Current Second, one or two digits without leading zeros

Last Modification

In order to use the last modification date of the file as placeholder, we can add the extension "-m" to the placeholders for the current time and date.

%date-m%Last modification date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy-m%-%mm-m%-%dd-m%)
%dd.mm.yyyy-m%Last modification date in the format "day.month.year" (two or four digits with leading zeros if necessary; short form for %dd-m%.%mm-m%.%yyyy-m%)
%yyyy-mm-dd-m%Last modification date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy-m%-%mm-m%-%dd-m%)
%time-m%Last modification time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh-m%-%ii-m%-%ss-m%)
%hh-mm-ss-m%Last modification time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh-m%-%ii-m%-%ss-m%)
%hh-mm-m%Last modification time in the format "hour-minute" (two digits with leading zeros if necessary; short form for %hh-m%-%ii-m%)
%yyyy-m%Last Modification Year written with four digits
%yy-m%Last Modification Year written with two digits
%mm-m%Last Modification Month, always two digits, leading zeros if necessary
%m-m%Last Modification Month, one or two digits without leading zeros
%dd-m%Last Modification Day, always two digits, leading zeros if necessary
%d-m%Last Modification Day, one or two digits without leading zeros
%hh-m%Last Modification Hour, always two digits, leading zeros if necessary
%h-m%Last Modification Hour, one or two digits without leading zeros
%ii-m%Last Modification Minute, always two digits, leading zeros if necessary
%i-m%Last Modification Minute, one or two digits without leading zeros
%ss-m%Last Modification Second, always two digits, leading zeros if necessary
%s-m%Last Modification Second, one or two digits without leading zeros

Creation Date

For using the file creation date as placeholder, we can add the extension "-c" to the placeholders for the current time and date.

%date-c%Creation date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy-c%-%mm-c%-%dd-c%)
%dd.mm.yyyy-c%Creation date in the format "day.month.year" (two or four digits with leading zeros if necessary; short form for %dd-c%.%mm-c%.%yyyy-c%)
%yyyy-mm-dd-c%Creation date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy-c%-%mm-c%-%dd-c%)
%time-c%Creation time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh-c%-%ii-c%-%ss-c%)
%hh-mm-ss-c%Creation time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh-c%-%ii-c%-%ss-c%)
%hh-mm-c%Creation time in the format "hour-minute" (two digits with leading zeros if necessary; short form for %hh-c%-%ii-c%)
%yyyy-c%Year of Creation written with four digits
%yy-c%Year of Creation written with two digits
%mm-c%Month of Creation, always two digits, leading zeros if necessary
%m-c%Month of Creation, one or two digits without leading zeros
%dd-c%Day of Creation, always two digits, leading zeros if necessary
%d-c%Day of Creation, one or two digits without leading zeros
%hh-c%Hour of Creation, always two digits, leading zeros if necessary
%h-c%Hour of Creation, one or two digits without leading zeros
%ii-c%Minute of Creation, always two digits, leading zeros if necessary
%i-c%Minute of Creation, one or two digits without leading zeros
%ss-c%Second of Creation, always two digits, leading zeros if necessary
%s-c%Second of Creation, one or two digits without leading zeros

Last Access

Likewise the modification date and creation date placeholders, the suffix "-a" is standing for the last access to the file or folder.

%date-a%Last access date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy-a%-%mm-a%-%dd-a%)
%dd.mm.yyyy-a%Last access date in the format "day.month.year" (two or four digits with leading zeros if necessary; short form for %dd-a%.%mm-a%.%yyyy-a%)
%yyyy-mm-dd-a%Last access date in the format "year-month-day" (two or four digits with leading zeros if necessary; short form for %yyyy-a%-%mm-a%-%dd-a%)
%time-a%Last access time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh-a%-%ii-a%-%ss-a%)
%hh-mm-ss-a%Last access time in the format "hour-minute-second" (two digits with leading zeros if necessary; short form for %hh-a%-%ii-a%-%ss-a%)
%hh-mm-a%Last access time in the format "hour-minute" (two digits with leading zeros if necessary; short form for %hh-a%-%ii-a%)
%yyyy-a%Last Access Year written with four digits
%yy-a%Last Access Year written with two digits
%mm-a%Last Access Month, always two digits, leading zeros if necessary
%m-a%Last Access Month, one or two digits without leading zeros
%dd-a%Last Access Day, always two digits, leading zeros if necessary
%d-a%Last Access Day, one or two digits without leading zeros
%hh-a%Last Access Hour, always two digits, leading zeros if necessary
%h-a%Last Access Hour, one or two digits without leading zeros
%ii-a%Last Access Minute, always two digits, leading zeros if necessary
%i-a%Last Access Minute, one or two digits without leading zeros
%ss-a%Last Access Second, always two digits, leading zeros if necessary
%s-a%Last Access Second, one or two digits without leading zeros

References

A special form of placeholders are references. References are placeholders that stand for single or multiple characters, words, lines, CSV cells, XML texts, XML attribute values or the content of entire files and can be used in the text fields of the TextConverter just like the other placeholders presented here. For an introduction to this topic with many examples as well as an overview over all available references, see the tutorial about using references in the TextConverter.

Placeholders in Scripts

Many of the placeholders presented here can also be used when we control the TextConverter via a script or via the command line. However, we have to consider that we have to double the percentages if we use the placeholders directly in the call within a script.

One example would be the following call in which we are using the placeholders %num% (number of the file), %name% (old name of the file without file extension), %folder-1% (name of the direct folder of the old file) and %date% (current date) for the name of the converted file:

TextConverter.exe -cl C:\test.txt "a=REPLACE a b" save-name=%%num%%_%%folder-1%%_%%name%%_%%date%%

If we do not double the percent sign, the operating system would treat the placeholders as variables within the script and replace them with the value of the respective variable before the value would even be passed to TextConverter. Some variables would remain completely empty or undesirable effects can be the result.

If we want to use placeholders in scripts inside actions, we have to consider that the placeholder option (Options > Actions > Placeholders) must also be activated inside script calls in order for the placeholder constants to be replaced (like it is when using the graphical user interface, too). This is not necessary for using placeholders in the file name (as shown in the first example).

If we pass a settings file to the TextConverter in a script call, we can store the activation directly within this settings file. If we work without settings files and pass individual actions or action lists as parameters, we can alternatively activate the placeholder option with the parameter "ph=1". An example of this is the following call, with which we replace the letter "t" in the file "test.txt" with the current time (we have doubled the % character in the %time% placeholder again):

TextConverter.exe -cl C:\test.txt "a=REPLACE t %%time%%" ph=1

You can read more about this topic in the tutorial about the script control of the TextConverter in the section about parameters for enabling placeholders and references.

Old Placeholders

Compared to the old version of the TextConverter, some changes to the placeholders were implemented in the current version. The new version offers significantly more placeholders than the old version, some placeholder have been renamed (for example %ext% instead of %extension%) or have become more flexible (the date formatting, for example). If you are still using the old version of the TextConverter, you will find all information on this topic in the overview of the old placeholders of the Text Converter.