Need a little help.
I have just a simple string with a lot double quotes in it. I need to be able to parse through this string, and know how many double quotes I have, and where I am, so I can key off every 9th double quote. For example (coding is not complete):
#!/bin/bash
count=0
CSV=$(long-string-with-double-quotes)
IFS="\""
for v in $CSV
**count double quotes here**
if [ $count -eq 9 ];then
echo "Count is 9"
count=0
else
printf "%s" $CSV
((count++))
fi
******
The problem is, I have no clue on how to count the number of double quotes in this string. I just need some syntax help if you can spare it. Thanks!