DelimiterCount: how to use a counter

Hi,
I am new to shell script. I want to count to Delimiter count for my source file. For that I have written script. When I tried to execute the script I could not able to view the results. It throws errors. I don't know what the problem is. My aim is I want to store the delimiter count in one file.

#-------------------------------------------------------------------------------------------------------
# Name        : Delimiter_Count_Check
# Usage       : Delimiter_Count_Check
# Description : This process is used to check the delimiter count in source files           
#-------------------------------------------------------------------------------------------------------
function Delimiter_Count_Check
{
     Src_FileName=mgmtfile_cntl_20101201.txt
     parameter=/opt/Files/${Src_FileName}_Delimitercount.txt
     #Delimiter Count
     Delimiter_Count=awk '{print $0, NR "|"}' $Src_FileName > $parameter
     echo "delimiter count is $Delimiter_Count"
     if [ $? -ne 0 ]
     then
          echo "ERROR : Problem in Delimiter check source file $Src_FileName"
     else
          echo "Delimiter count for source file is $Delimiter_Count"
     fi
}

#call function

function call
{
     if [ -f  Delimiter_Count_Check]
     then
          Delimiter_Count_Check
     fi
}

I guess your delimiter is |.

count=0
while read line
do
linedel=`echo "$line" | awk -F"|" '{print NF-1}'`
count=$((count + linedel))
done < srcfile

Hi,
could you please replay me..
do you want total delimiters or line wise delimiters?

"cat filename|tr -d '[:alnum:]' > newfilename"

this may be help you..

regards
rajesh

Hi Rajesh,

Thanks for your reply. I want total count of the delimiter for my source file. The output I want to store in one file. Then I should move that file into my unix directory. I hope I explained you clearly. Plz help me to resolve this issues.

What is the final goal of counting and storing the number of delimiters ?