Let's think about a next level:
How to just get the file names that match the MFI search criteria?
hm ...
a workaround:
use the background color of the HTML export
Fortunately, I found this post:
Search a string for all occurrences of a pattern *)
Thanks @Craige_Hales !!!
Great that there is a way in JMP to do global pattern matching without a for loop ....
but I also agree with @jthi: an option GLOBAL MATCH for Regex Match would be nice:
Add flag to Regex Match() to find all non-overlapping occurances of pattern
anybody else who wants to support the wish with a Kudo?
I am still struggling to understand how it works exactly - e.g. why is the
| Pat Len(1)
necessary?
mfi = Multiple File Import(
<<Set Folder( "C:\TEMP\" ),
<<Set Name Filter( "*.txt;" ),
<<Set Name Enable( 1 )
);
boxtop = mfi << createwindow;
scb=boxtop[StringColBox("File Name")];
txt = scb <<get html;
palindrome = Pat Regex( "bgcolor=#000000.*?>" ) + // selected filename by background color
(Pat Regex( ".*?")) >> middlePart + // this is what we want to get
Pat String("</td"); // the tail
list = {};
Pat Match(
txt,
Pat Repeat(
(palindrome +
Pat Test(
Insert Into( list, middlePart );
1 // pat Test returns 1(OK) because we are not actually testing anything...just wanted to run some JSL
)//
)
| // above adds to list, below skips forward a letter to try again
Pat Len( 1 ) // this bit is more important than it looks; it matches all the text that isn't interesting
)
);
Show( list);