#!/vol/bin/perl # author: Nils Jahn # usage: perl tasx2textgrid.pl input > output # The program converts an XML file (tasx) into a praat TextGrid file. sub initVariables { $items = 0 ; $sges = 1000 ; $eges = 0 ; undef $/ ; $fname = $ARGV[0] ; $cont = readFile($fname) ; $laynr = 1 ; } sub readFile { $file = shift ; open(FILE, "<$file") ; return $fileContents = ; } sub getValues { while ($cont =~ m/ $eges ; } } sub main { # print header of output file print "File type = \"ooTextFile\"\n" ; print "Object class = \"TextGrid\"\n\n" ; print "xmin = $sges\n" ; print "xmax = $eges\n" ; print "tiers? \n" ; print "size = $items\n" ; print "item []:\n" ; # write layer information to output file while ($cont =~ m/(.*?)