This question is similar to Solved: Extract the last two values from rows in text file... - Alteryx Community
A text file includes data like this:
ISP-123456 2 C 2 2
ASI-123213 A 3 1 5
PSI-123233 A 2 3 7
SRI-213232 1 4 9
SIR-122323 1 2 24 0
TIS-123980 C B 1
BSI-231897 1 3 8 T
Suppose that I always want to extract the values from column 4 ( 2, 1, 3, 4, 24, 8 ) if there is a value in that column. How do I achieve this?
if regex_match([test],"^.*\s(\d+)(\s.*$)") then
regex_replace([test],"^.*\s(\d+)(\s.*$)","$1",0) else null() endif
works with your sample data - in a formula tool. This assumes that the second to last row should be a null and any entries that don't have a number in the fourth position should be nulls.
User | Count |
---|---|
52 | |
27 | |
25 | |
24 | |
21 |