@antidote
$Read1=StringLeft($Read[1],3-7+_Min(7,StringLen($Read[1]))+3-StringLen(StringRegExpReplace(StringLeft($Read[1],4)," ",""))) & StringRight(StringRegExpReplace(StringLeft($Read[1],7-7+_Min(7,StringLen($Read[1])))," ",""),3);
1.) StringLeft($Read[1],3codes)---> the base code
2.) -7+_Min(7,StringLen($Read[1])) ---> Identifies the digit of the true value w/c is 7 if true value is 100,000 and above. if true value is 10_000 length is 6 which will give us a deduction in string length by 1(-7+min(7,6)). ex 10_000, instead of getting 3 digits from the left, we only get 2 digits from the base code regardless of the numbers appearing on the middle blank space or regardless of the last digits errors.
3.) +3-StringLen(StringRegExpReplace(StringLeft($Read[1],4)," ","")) ---> Identifies " " blank spaces by meassuring the change of stringlength of 4 string if blanks are deleted. This corrects the reading of the left 3 digits (of the 5digit true value/10k) incase of numbers appearing on blanks at the middle (_23'4'567).
& ----> separate codes between left and right digits
4.) StringLeft($Read[1],7)----> the base code1. Get 7 digits from the left
5.) -7+_Min(7,StringLen($Read[1]))) ---> Applies to base code 1. Identifies the digit of the true value w/c is 7 if true value is 100,000 and above. if true value is 10_000 length is 6 which will give us a deduction in string length by 1(-7+min(7,6)). ex 10_000, instead of getting 7 digits from the left, we only get 6 digits from the base code regardless of the numbers appearing on the middle blank space or regardless of the last digits errors.
6.) StringRegExpReplace(base code1+addons," ","")--->removes the white spaces. this eliminates the blank space on the right most part if the true value has only 6 digits. ex. true value=68,650 tesseract=68_650_4 ---> string length=8. Apply the above code and we get 68_650_. Instead of getting 50_, we eliminate '_' first to get a 3 digit w/c in our case is 650.
7.) StringRight(codes,3)--->base code 2. Get 3 digits from the right.