How to find the number of column in the text file...?

Hi,

i have text file with ~ seperated columns. it is very huge size of file,
in the file sompulsary supposed to has 20 columns with ~ seperated.
so how can i find if the file has 20 column in the all rows...?

Sample file:

APA+VU~10~03~101~101~APA.N O 20081017 120.00 AP~USD~US~7.650000
APV+JY~10
~03~101~101~AAPL.O O 20081017 230.00 AC~USD~US~3.125000
APV+VL~10~03~101~101~AAPL.O O 20081017 160.00 AP~USD~US~9.750000
AT000000STR1~08~B28DT41~02
~05~30STRV.VI~EUR~AT~48.990000
AT0000606306~08~B0704T9~02~05~30RIBH.VI S~EUR~AT~84.580000
AT0000612601~08~B067M97~02
~05~30ICEL.VI S~EUR~AT~31.900000~20~21

Let me know if need more info on this

Regards,
MPS:b:

This should print the lines with less or more then 20 columns:

awk -F'~' 'NF!=19{print}'

Regards