Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Text parsing, length unknown.

Featured Replies

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....

 

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.

  • Author

Thanks for your expert opinion.  And why are you here on a Saturday? :)

32 minutes ago, Steve Martino said:

And why are you here on a Saturday?

Why not? I don't work here.

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.

 

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...

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.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.