#!/usr/bin/perl
$file = $ARGV[0];
$comment = `grep \\# $file \| transform.pl`;
#print $comment;
$nrow = `grep -v \\# $file \| wc -l`;
chomp $nrow;
$xmlfile = $file . ".xml";
open (TEMPLATE, "template3.xml");
open (OUTPUT, ">$xmlfile");
while (<TEMPLATE>) {
    s/\?name\?/$file/;
    s/\?nrow\?/$nrow/;
    s/\?comment\?/$comment/;
    print OUTPUT;
}
exit;
