Using Raku (formerly known as Perl_6)
raku -ne 'put m:g/\"/.elems;'
OR
raku -ne '.match( /\"/, :global).elems.put;'
Sample Input (task is to count " doublequotes):
zero
"two"
"two","four"
"two","four","six"
"two","four","six","eight"
Sample Output:
0
2
4
6
8
FYI, I try very hard to stump Raku with Unicode characters and the language performs very well (it does NFC Normalization under-the-hood). It seems to have earned the moniker "Unicode-ready". Below, counting Bengali letters with Raku:
Sample Input (Bengali days-of-the-week from Wikipedia):
~$ cat Bengali_DOW.txt
রবিবা��/সূর্যবার Rabibār/Sūryabār
সোমবার/চন্দ্রবার Somabār/Chandrabār
মঙ্গলবার Mangalbār
বুধবার Budhabār
বৃহস্পতিবার/গুরুবার Brihaspatibār/Gurubār
শুক্রবার Shukrabār
শনিবার Shanibār
Sample Output (testing with first letter of each line):
~$ raku -ne 'put m:g/ <[র সসো ম বু বৃ শু শ]>শ %]> /.elems;' Bengali_DOW.txt
3
45
2
2
3
3
2
https://docs.raku.org/language/unicode#Normalization
https://raku.org