Last active
January 24, 2018 13:01
-
-
Save rebolek/30a14921bdeec47261e80f7febb1475e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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