lastword
because
the last word is used as the value for the free:
label already.
The default value of 000 is used for the third label in these entries.
Command: text2sus @testfree.dat < testfree.txt | sus2text
testfree.data
# This is a command-line file for text2sus # Each option is defined in a line, empty lines or lines # beginning with "#" are ignored. --next=\n # This indicates that each line is a separate record test # We want to parse for the keyword test. freetext=free:\s*(\w+) # And for the first word after "free:", the label for this will be # "freetext". (?P<lastword>\w+)$ # And for the last word in the line, getting the label "lastword"
testfree.txt
test: 123, free: sadds, ewrwre test: 444, free: dfgf, trwret test: 123, free: sadds test: 444, free: dfgf
output
test freetext lastword 123 sadds ewrwre 444 dfgf trwret 123 sadds 000 444 dfgf 000