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
#2
Macro Macro3237
Code:
Copy      Help
;out a
for int'i 0 a.len
,out a[1 i]
#3
thank you so much


Forum Jump:


Users browsing this thread: 1 Guest(s)