I came up with this snippet but feel it can be improved. It will count the number of words in a document but it's a 'clumsy' regular expression, so any input would be appreciated. ConsoleWrite(_WordCount(@ScriptFullPath) & ' words' & @CRLF)
Func _WordCount($sFilePath)
Local $aArray = StringRegExp(FileRead($sFilePath), '([S*]+)', 3)
Return UBound($aArray)
EndFunc ;==>_WordCount