Try this, it works for me with your data. You may need to change the "For...Next" loop to suit the data that you actually want to extract.

code:
$InputFile="testdata.txt"
$OutputFile="Extract.txt"

; ----------------
; Open input file.
; ----------------
If OPEN(1,$InputFile)
"Cannot open input file " $InputFile " for reading." ?
"ERROR: " @ERROR " - " @SERROR ?
Quit 1
EndIf

; -----------------
; Open Output file.
; -----------------
If OPEN(2,$OutputFile,5)
"Cannot open input file " $OutputFile " for writing." ?
"ERROR: " @ERROR " - " @SERROR ?
$nul=Close(1)
Quit 1
EndIf

; -------------------------
; Read all lines from input
; -------------------------
$Line = READLINE(1)
While @ERROR = 0
$Segment = Split($Line, "*")
$SegmentSize=Ubound($Segment)
IF $Segment[0] = "SDQ"
For $Pos = 3 to $SegmentSize Step 2
If $Segment[$Pos] <> ""
If WriteLine(2, $Segment[$Pos] + @CRLF)
"Cannot write to output file " $InputFile ?
"ERROR: " @ERROR " - " @SERROR ?
Quit 1
EndIf
EndIf
Next
EndIf
$Line = READLINE(1)
Loop
; ---------------------------
; Close open file descriptors
; ---------------------------
$nul=Close(2)
$nul=Close(1)