Skip to content

Instantly share code, notes, and snippets.

@rebolek
Last active January 24, 2018 13:01
Show Gist options
  • Save rebolek/30a14921bdeec47261e80f7febb1475e to your computer and use it in GitHub Desktop.
Save rebolek/30a14921bdeec47261e80f7febb1475e to your computer and use it in GitHub Desktop.
Red[]
count-lines: func [
filename
/local
file count ws
][
ws: charset " ^-"
file: read/lines filename
count: 0
foreach line file [
unless any [
empty? line
parse line [some ws]
parse line [any ws #";" to end]
][
count: count + 1
]
]
count
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment