awk or grep

Urgent
File contains: baba�kkek�aklk���
bnbnbn�vmvm�

File name: Openfile

I want to find number of pipe(�) symbols in a file(count).That is total count of pipes in a file or a line.

I dont want number of line it occurs.

Try to search the forums first:

sed "s/|/|\\
/g" file | grep -c "|"

If you have Python, here's an alternative:

all_data = open("file").read()
print all_data.count("|")

Another solution using awk :

awk -v RS='' '{ print gsub(/|/, "") }' file

Jean-Pierre.