I’ve written a small plugin to overcome my frustrations from using the @FILTER function in TCC. It’s possible no one else finds it frustrating (or possibly no one else uses @FILTER!), but I thought I’d offer it for download in case it’s helpful to other users.
For those not familiar with it, @FILTER extracts the requested characters from the supplied string. For example, to extract just the digits from a string you use it like this:
Extracting alphabetic characters requires you to type the entire alphabet twice, once in upper case and once in lower case:
My plugin, called FilterPlus, allows the use of shortcuts to represent some common sequences of characters. To extract just the digits as in the previous example, the shortcut “~d” is available:
and for alphabetic characters ~A means a lot less typing and less chance of a typo:
The other shortcuts available are
~D - extracts digits and the decimal character as defined in the user locale:
~l - extracts lowercase alphabetic characters:
~U - extracts uppercase alphabetic characters:
I’m afraid the plugin is only available as a 64-bit version as I have no longer have any means of testing 32-bit plugins.
If anyone would like to try the plugin it can be downloaded from this dropbox location. If you do find it a useful plugin, please reply in this thread and I’ll ask Rex to add it to those available on the JP Software website.
For those not familiar with it, @FILTER extracts the requested characters from the supplied string. For example, to extract just the digits from a string you use it like this:
Code:
d:\>echo %@filter[0123456789,ABC123.45abc]
12345
Extracting alphabetic characters requires you to type the entire alphabet twice, once in upper case and once in lower case:
Code:
d:\>echo %@filter[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghujklmnopqrstuvwxyz,ABC123.45abc]
ABCabc
My plugin, called FilterPlus, allows the use of shortcuts to represent some common sequences of characters. To extract just the digits as in the previous example, the shortcut “~d” is available:
Code:
d:\>echo %@filter[~d,ABC123.45abc]
12345
and for alphabetic characters ~A means a lot less typing and less chance of a typo:
Code:
d:\>echo %@filter[~A,ABC123.45abc]
ABCabc
The other shortcuts available are
~D - extracts digits and the decimal character as defined in the user locale:
Code:
d:\>echo %@filter[~D,ABC123.45abc]
123.45
~l - extracts lowercase alphabetic characters:
Code:
d:\>echo %@filter[~l,ABC123.45abc]
abc
~U - extracts uppercase alphabetic characters:
Code:
d:\>echo %@filter[~U,ABC123.45abc]
ABC
I’m afraid the plugin is only available as a 64-bit version as I have no longer have any means of testing 32-bit plugins.
If anyone would like to try the plugin it can be downloaded from this dropbox location. If you do find it a useful plugin, please reply in this thread and I’ll ask Rex to add it to those available on the JP Software website.