Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular gets the text
#1
Hi,
I want to get the red text in the following multiple lines of text
The following Powershell code achieves the goal
What is the QM code with the same effect

Thanks in advance for any advice and help
david


Unche %P_Ou%; Value; DeviceID%
anch; %P_Er%; Text%
bncheck %S_Bt%; Val%;

 
Code:
Copy      Help
 @"
Unche %P_Ou%; Value; DeviceID%
anch; %P_Er%; Text%
bncheck %S_Bt%; Val%;
"@ | Select-String -Pattern '(?m)%([^%]*)%.*$' -AllMatches |
Foreach-Object { $_.Matches | %{ $_.groups[1].value } }


Macro Macro4
Code:
Copy      Help
out
str dd=
;Unche %P_Ou%; Value; DeviceID%
;anch; %P_Er%; Text%
;bncheck %S_Bt%; Val%;

str pattern="(?m)%([^%]*)%.*$"
str d
ARRAY(str) a
findrx(dd pattern 0 4 a)
out a


Messages In This Thread
Regular gets the text - by Davider - 09-29-2022, 10:59 AM
RE: Regular gets the text - by Gintaras - 09-29-2022, 11:43 AM
RE: Regular gets the text - by Davider - 09-29-2022, 12:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)