Steve Martino Posted December 5, 2015 Posted December 5, 2015 Hello forum. I'm having a little trouble parsing a QR Code. The problem is the length isn't always the same, but the letters used to separate the data are consistent. In this example, how would I extract the value of 10.0 which is between the C and the H. I guess what I'm trying to figure out in words is (not so simply for me); "Take the value between C and H and put it in the calculation for the field CO2'. After that, parsing the rest would be similar. I'm ok with the parsing with Left, Middle, Right, and using Position, but I cant figure out how to get the result of the varying length between any 2 letters (C & H) in this case. I've seen examples of using something similar by nesting these functions together, but that's a little beyond my basic understanding. Here's the QR code: 00102459A1205150110B0C10.0H00D0E76.1F51.8G7.5I60.6J681K-0.03 And here's the break down of code on the left, and the fields I would parse them into: 0010:24:59A TIME (A for AM, P for PM) 1205150110 DATE B0 CO C10.1 CO2 H00 Not used D0 COAF E76.1 Eff F51.8 EA G7.5 O2 I60.6 TAir J681 TStk K-0.03 Pre This is what I came up with, just didn't know if this was correct, or if there is a better way(didn't test it on all fields yet): Let([ @start=Position(TestResults::Result;"c";1;1)+1; @end=Position(TestResults::Result;"h";1;1); @length=@end-@start ]; Middle(TestResults::Result;@start;@length) ) Any help or guidance to point me in the right direction is greatly appreciated. Thanks Steve PS, I'm willing to bet one frequent helper on this site will rattle this off like childs play....
comment Posted December 5, 2015 Posted December 5, 2015 46 minutes ago, Steve Martino said: Any help or guidance to point me in the right direction is greatly appreciated. Your approach is the right direction.
Steve Martino Posted December 5, 2015 Author Posted December 5, 2015 Thanks for your expert opinion. And why are you here on a Saturday?
comment Posted December 5, 2015 Posted December 5, 2015 32 minutes ago, Steve Martino said: And why are you here on a Saturday? Why not? I don't work here.
Josh Ormond Posted December 5, 2015 Posted December 5, 2015 Dang...you mean we aren't getting paid for this? I need to speak to the Administrator!!! 1 hour ago, comment said: Why not? I don't work here. 1
comment Posted December 5, 2015 Posted December 5, 2015 16 minutes ago, Josh Ormond said: Dang...you mean we aren't getting paid for this? You would have more credibility if you had waited till Monday morning to post this... 2
jbante Posted December 6, 2015 Posted December 6, 2015 You're on the right track. There are also many custom functions either to use or to look at for inspiration. This is the one I use.
Recommended Posts
This topic is 3344 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now