#!/bin/sh
N=`grep '^STARTCHAR' "$1" | wc -l`
#echo $N
mv "$1" "$1.1orig"
awk -e '$1=="CHARS" {$2='$N'}; {print}' "$1.1orig" >"$1"