Changing text from barcode in a search field
We are using a bar code reader to input text into a field in search mode. This works with the 1D barcodes our clients have been sending us. The FM script selects the field, enters search mode, inputs the barcode, performs the search, then continues to perform its task.
Then our clients started sending some 2D barcodes. The 1D barcodes have the exact record information, but the 2D barcodes have extra characters concatenated to the end.
The field text we search is in a format like this BD13-1 or BD13-6759
(the numbers start at 1 and count up, with no leading zeros, meaning the number of characters varies)
The extra concatenated characters are in this format ;R;2RRR (semicolon, a letter, a semicolon, a number, followed by three letters). The total number of characters to remove from the end is seven.
So the 1D looks like BD13-1 or BD13-6759 and the 2D looks like
BD13-1;P;3XYZ or BD13-6759;R;5ABC
In case that's confusing, I will explain another way. If I were to search with wild cards to select the unwanted characters, I would type ;@;#@@@ and we want to keep @@##-#. Another way to say this is, we want to search by exact match in the 1D and everything in front of the semicolon in the 2D.
Being as the letters/numbers we want are not always the same length I can't use the left command. I can't use a right command because we might scan a 1D or 2D number and the 1D is correct.
Replace doesn't work because the place number is not always the same.
I would like to use the substitute command with wildcards such as ;@;#@@@
and replace with "" (nothing) but it won't substitute text entered into a field while in find mode. Or am I just going about this the wrong way altogether?
I want it to be able to scan either bar code and find the correct record.