Python Forum
Find string between two substrings, in a stream of data
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find string between two substrings, in a stream of data
#1
I have this continuous serial data stream:

----------------------------------------

SENSOR COORDINATE         = 0

MEASURED RESISTANCE       = 3.70 kOhm

----------------------------------------

----------------------------------------

SENSOR COORDINATE         = 1

MEASURED RESISTANCE       = 3.70 kOhm

----------------------------------------

----------------------------------------

SENSOR COORDINATE         = 2

MEASURED RESISTANCE       = 3.69 kOhm

----------------------------------------
For each iteration, i want to be able to grab the values. The sensor coordinate value, and the resistance value.

I found solutions using
.split()
and with regular expressions, but the problem is that in my case, there is not one string that i want to filter, but a continuous stream.

For example,
.split()
will find my string, but it will split the stream in half. This does not work, in a continuous stream, for more than one time.
Reply


Messages In This Thread
Find string between two substrings, in a stream of data - by xbit - May-08-2021, 10:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Microphone stream manipulation Talking2442 1 2,753 Nov-19-2023, 02:08 PM
Last Post: palumanic
Question in this code, I input Key_word, it can not find although all data was exact Help me! duchien04x4 3 1,058 Aug-31-2023, 05:36 PM
Last Post: deanhystad
  EEG stream data with mne and brainfolw PaulC 0 501 Aug-22-2023, 03:17 AM
Last Post: PaulC
  get data from excel and find max/min Timmy94 1 1,123 Jul-27-2022, 08:23 AM
Last Post: Larz60+
  what will be the best way to find data in txt file? korenron 2 1,173 Jul-25-2022, 10:03 AM
Last Post: korenron
  Substitue multiple substrings in one command Pavel_47 0 842 Jul-18-2022, 01:24 PM
Last Post: Pavel_47
  Find and Replace numbers in String giddyhead 2 1,251 Jul-17-2022, 06:22 PM
Last Post: giddyhead
  Decoding a serial stream AKGentile1963 7 8,631 Mar-20-2021, 08:07 PM
Last Post: deanhystad
  Regular expression: cannot find 1st number in a string Pavel_47 2 2,433 Jan-15-2021, 04:39 PM
Last Post: bowlofred
  Using lambdas and map() to parse substrings in a single line Drone4four 5 3,071 Sep-20-2020, 10:38 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020