################################################################################################# # actual-TextGrid-creator8.praat (Version 8) # Written by Kyuchul Yoon ( kyoon@ling.osu.edu ) # Lets you create the actual TextGrid file by moving around the boundaries created # in the 075.TextGrid-segmented2 folder # Assumes that you have two subdirectories "075.TextGrid-segmented2" and "08.TextGrid-segmented-labeled" # Will write modified TextGrid files (with .lab) into the subfolder "08.TextGrid-segmented-labeled" ################################################################################################## # Specify files and folders form Select files word textGridFolder_(should_be_a_subfolder) 085.TextGrid-segmented-labeled2 word textGridExt lab2 word textGridDoneFolder_(should_be_a_subfolder) 086.TextGrid-segmented-labeled3 word outputExt lab3 endform Create Strings as file list... fileList 'textGridFolder$'\*.'textGridExt$' Sort numFiles = Get number of strings pause 'numFiles' textgrids were identified. Continue? for iFile to numFiles select Strings fileList # Get the name for each file fullFileName$ = Get string... iFile # Extract the prefix part of the filename prefixName$ = fullFileName$ - textGridExt$ # Read in the file Read from file... 'textGridFolder$'\'fullFileName$' Rename... textGrid Remove tier... 6 Remove tier... 5 Remove tier... 4 Remove tier... 3 Remove tier... 2 # Save the modified TextGrid file in a different folder with .done suffix attached select TextGrid textGrid Write to text file... 'textGridDoneFolder$'\'prefixName$''outputExt$' Remove endfor