Count specific word or character per line

Hi,

I need help regarding counting specific word or character per line and validate it against a specific number i.e 10. And if number of character equals the specific number then that line will be part of the output.

Specific number = 6
Specific word or char = ||
Sample data:
1||2||3||4||afa||adfasf||asdf
1||2||3||4||afa||adfasf
1||2||3||4||afa
4||2||3||4||afa||ad||a

Output should be:
1||2||3||4||afa||adfasf||asdf
4||2||3||4||afa||ad||a

Thanks in advance.

user@host> (/home/user) $ count=7
user@host> (/home/user) $ a="[|][|]"
user@host> (/home/user) $ awk 'BEGIN{FS="'$a'"} {if("'$count'"==NF){print}}' test.txt
1||2||3||4||afa||adfasf||asdf
4||2||3||4||afa||ad||a
user@host> (/home/user) $
user@host> (/home/user) $

This works as you suggsted, but you need create pattern variable for your word/char