Open
Description
Motivation
I regularly need to count the number of delimiter-separated fields in a string.
When files have an arbitrary number of fields in a line, and you need to read them in to an allocatable array. Reading the line to a buffer and counting the number of fields in a line so that the array can first be allocated is very handy.
This is also particularly useful in the following situation:
line = "Hello there how are you?
where the delimiter is repeated, and you want to just count the number of delimiter-separated fields.
Prior Art
- wordcount (wc) in bash
Additional Information
No response