开云体育

ctrl + shift + ? for shortcuts
© 2025 Groups.io

parsing characters after specific text in a string - ideas?


 

Hi All,

hoping the collective brainpower of the group may have a solution.
Sometimes I get stuck on the simple things.


I need to work on displaying TX power setting for current band and looking for a way to parse specific characters after a particular part of a string.

Let’s say the string coming in is afgfadaefdvdvsdsscdwqout23fdhhgfgsjdgfsdfiop

I want to parse the 23 after out. So need to look at the string for out then parse the next two characters after out. Any ideas? Sometimes I get stuck on the easiest things.

This will help with the ability to reliably parse all meter data out of the Flex radio.
?

73
Dave wo2x


 

Dave

Did you try the string node?

?

It is not installed by default.? ? It has about 20 parsing options.

Mike??


On Fri, Jul 10, 2020 at 11:06 AM David De Coons wo2x <RocketNJ@...> wrote:
Hi All,

hoping the collective brainpower of the group may have a solution.
Sometimes I get stuck on the simple things.


I need to work on displaying TX power setting for current band and looking for a way to parse specific characters after a particular part of a string.

Let’s say the string coming in is afgfadaefdvdvsdsscdwqout23fdhhgfgsjdgfsdfiop

I want to parse the 23 after out. So need to look at the string for out then parse the next two characters after out. Any ideas? Sometimes I get stuck on the easiest things.

This will help with the ability to reliably parse all meter data out of the Flex radio.
?

73
Dave wo2x


 

开云体育

I do have the string node installed. I probably should have also been a little more specific. If I send the UDP listener to buffer I get a hex stream Meter 16 shows up as 00 16 d ce

?

I want to parse the c de then convert to base 10 and divide by 240 to result in 13.725 volts.

?

The meter stream is not consistent in length or position as some meters update quicker than others.

?

73

Dave wo2x

?

?

Sent from for Windows 10

?

From: Michael Walker
Sent: Friday, July 10, 2020 11:30 AM
To: [email protected]
Subject: Re: [nodered-hamradio] parsing characters after specific text in a string - ideas?

?

Dave

?

Did you try the string node?

?

?

?

It is not installed by default.? ? It has about 20 parsing options.

?

Mike??

?

On Fri, Jul 10, 2020 at 11:06 AM David De Coons wo2x <RocketNJ@...> wrote:

Hi All,

hoping the collective brainpower of the group may have a solution.
Sometimes I get stuck on the simple things.


I need to work on displaying TX power setting for current band and looking for a way to parse specific characters after a particular part of a string.

Let’s say the string coming in is afgfadaefdvdvsdsscdwqout23fdhhgfgsjdgfsdfiop

I want to parse the 23 after out. So need to look at the string for out then parse the next two characters after out. Any ideas? Sometimes I get stuck on the easiest things.

This will help with the ability to reliably parse all meter data out of the Flex radio.?

73
Dave wo2x

?


 

开云体育

I addition to wanting to parse x characters after a specific phrase in a string I would like to be able to do the same with a buffer stream.

?

Thanks

Dave wo2x

?

?

Sent from for Windows 10

?

From: David De Coons wo2x via groups.io
Sent: Friday, July 10, 2020 11:06 AM
To: [email protected]
Subject: [nodered-hamradio] parsing characters after specific text in a string - ideas?

?

Hi All,

hoping the collective brainpower of the group may have a solution.
Sometimes I get stuck on the simple things.


I need to work on displaying TX power setting for current band and looking for a way to parse specific characters after a particular part of a string.

Let’s say the string coming in is afgfadaefdvdvsdsscdwqout23fdhhgfgsjdgfsdfiop

I want to parse the 23 after out. So need to look at the string for out then parse the next two characters after out. Any ideas? Sometimes I get stuck on the easiest things.

This will help with the ability to reliably parse all meter data out of the Flex radio.?

73
Dave wo2x

?


 

Hi Dave,

Did you et this figured out or is it still an open question?

Gary
K6HN


 
Edited

Hi Gary,
?
I have not gone back to investigate it since posting the question.
?
The radio returns rfpower= for the current TX slice plus every band set up in the TX Band Setting table. I want to parse only the TX slice power slider value.
?
I have an idea and can test tomorrow. Have to do some volunteer consulting for my former employer this afternoon.?
?
73
Dave wo2x

?

On Jul 16, 2020, at 12:51 PM, K6HN <gary@...> wrote:

Hi Dave,

Did you et this figured out or is it still an open question?

Gary
K6HN


 

Here is what I would use to get the '23' after the 'out'.

string = 'afgfadaefdvdvsdsscdwqout23fdhhgfgsjdgfsdfiop'
pos = string.search('out')? ? ? ? ?// find the start of 'out' in the string
pos = pos + 3? ? ? ? ? ? ? ? ? ? ? ? ? // add 3 to the start of 'out' to indicate the end of 'out'
data = string.slice(pos,pos + 2)? ? ? ? ? //get the 2 characters after the position of 'out'

There are many other ways to do this in Javascript.


 

开云体育

The issue is the messages are not always the same length and the word rfpower= appears over 10 times. I need to look for a unique keyword for the portion pertaining to the transmit slice.?

The other option I have is to get band data from my amp flow (80 for example) then do an if then function where if (band == 80){
Msg.band = 80
}

Do that for all bands.?

Then look for band 2 in the stream and then parse the Number after rfpower=

Since the length and contents of the messages from the radio vary that is probably the best way.?

73
Dave wo2x

Sent from my waxed string and tin cans.?

On Jul 16, 2020, at 1:20 PM, K6HN <gary@...> wrote:

?

Here is what I would use to get the '23' after the 'out'.

string = 'afgfadaefdvdvsdsscdwqout23fdhhgfgsjdgfsdfiop'
pos = string.search('out')? ? ? ? ?// find the start of 'out' in the string
pos = pos + 3? ? ? ? ? ? ? ? ? ? ? ? ? // add 3 to the start of 'out' to indicate the end of 'out'
data = string.slice(pos,pos + 2)? ? ? ? ? //get the 2 characters after the position of 'out'

There are many other ways to do this in Javascript.