# convert a plain txt data file with 3 numerical columns (x,y,z) # into a valid xyz file # commented lines in the original data file are omitted # Known limitation: cannot work in a pipeline, needs a real input file grep -v "^#" $1 | wc -l echo "# converted from $1 by $0" awk '/^[^#]/{print "C ",$0}' $1