Louis I. answered 05/05/19
Computer Science Instructor/Tutor: Real World and Academia Experienced
As far as I know, you cannot coach "cut" into processing adjacent delimiter char as a single delimiter string.
It in fact, cut will always assume the opposite - 2 adjacent delimiters represent an empty value for that "indexed" field.
Consider the following file:
1,2,3,4
2,,,4
3,,,4
4,,,4
We would tend to want "cut -f4 -d, file" to display four 4's
... and "cut -f2 -d, file" to display one 2 and 3 blanks.
Making cut "flexible" enough to optionally deal with repeated delimiters as you suggest would over-complicate a simple utility like "cut" ... (in my opinion anyway).
Yes, using awk or some combination of sed/cut is probably as good as it gets.
## See file content above ...
$ cut -f4 -d, file
4
4
4
4
$ cut -f2 -d, file
2