And if you want to try out some regular expressions try this tool and switch to the Python language: https://regex101.com/
Code: Select all
DataSection
cad:
Data.s "D1 SOD523 285 705 0 DX.410052E 0 0"
Data.s "* some comment"
Data.s ~" D1\t\tS0D521 285 705\t 0 DX.410125E\t0 0"
Data.s ""
EndDataSection
regex = CreateRegularExpression(#PB_Any, "^\s*([^*]+?\b)\s+(\w+)\s+(\d+)\s+(\d+)\s+(\d+)\s+([0-9a-zA-Z.]+)\s+(\d+)\s+(\d+)\s*$")
Define line.s
Restore cad
Repeat
Read.s line
Debug "--------------------------------"
Debug line
If line = ""
Break
EndIf
If ExamineRegularExpression(regex, line)
If NextRegularExpressionMatch(regex)
For i = 1 To 8
Debug " " + i + ": '" + RegularExpressionGroup(regex, i) + "'"
Next
Else
Debug " Comment or wrong syntax"
EndIf
Else
Debug " Error"
EndIf
ForEver