AJAX can't filter data, it will load the entire file. And you will need to find 4-letter words in AJAX data.
How is your text file formatted?
If it contains a list of words separated by the same symbol (comma, space, line break etc.), then it's easy.
Use expressions Tokencount() to get the number of words, TokenAt() to retrieve each word, and Len() to check word length.
For example - loop from 0 to Tokencount, compare each word length, if it's 4 letters, then add this word to an array.
If the file has a different structure or contains some random text, it may be a bit more complicated.