Quite new to Linux at the moment,

I've seen some straightforward answers for appending a constant/non-changing word/component to the end of a file e.g. [shell script add suffix each line](https://stackoverflow.com/questions/16991035/shell-script-add-suffix-each-line)

However, I'd like to know how to append the word count for each line of a .csv file to the end of each line, so that:

```
word1, word2, word3
foo1, foo2
bar1, bar2, bar3, bar4

```

Becomes:

```
word1, word2, word3, 3
foo1, foo2, 2
bar1, bar2, bar3, bar4, 4

```

I am working with comma separated values, so if there is a quicker/simpler way to do it by making use of the commas rather than the items, then that would work as well.

Cheers!