newlisp/guiserver/word-count.lsp

12 lines
249 B
Text
Raw Permalink Normal View History

2016-06-11 17:22:37 +00:00
;; demo script: word-count.lsp
;; this script is registered in the Tool menu of newlisp-edit.lsp
(set 'content (read-file (main-args 2)))
(println
"Words: " (length (find-all "\\w+" content))
" Bytes: " ((file-info (main-args 2)) 0))
(exit)