Check %SYSTEM.License queries. There are queries which provide summary and detailed information on license consumption. You can than create a task which runs every minute and if license consumption exceeds say 80%, store current license users into a separate table with a timestamp. Later you can use this table to analyze usage patterns.

What do you want your $list to look like?

If you want the end result to be like this:

$lb("das", "is", "wp", "dsa", "nmk")

try this code (assumes dir is shorter that 3 641 144 chars):

ClassMethod test(dir = "test.txt")
{
    set file = ##class(%Stream.FileCharacter).%New()
    set file.LineTerminator = $c(1)
    do file.LinkToFile(dir)
    
    set str = file.Read($$$MaxStringLength)
    
    kill file
    
    set separator = $c(13,10)
    do {
        set newstr = str
        set str = $replace(str, separator _ separator, separator)
    } while newstr'=str
    
    set:$e(str, 1, $l(separator))=separator str=$e(str, 1 + $l(separator), *)
    set:$e(str, *-$l(separator)+1, *)=separator str=$e(str, 1, *-$l(separator))
    set list = $lfs(str, separator)
    quit list
}

This is a naive implementation assuming you don't care about the speed.

Faster solution would go through file line by line.