########################################################################### # remove.romanized.token.from.wagon.files.praat # Written by Kyuchul Yoon ( kyoon@ling.osu.edu ) # Removes the rightmost column from the wagon files, i.e. the "extra" fields that Wagon complains about ############################################################################ # Specify files and folders form Select files word subFolderToProcess kcy-wagon-datafile-orig word inputFileName 2.kcy-tagset.size-35.wagon.original.datafile word outputFileExt .last.col.removed endform # Get the input filename Read Strings from raw text file... 'subFolderToProcess$'\'inputFileName$' Rename... file numLines = Get number of strings outFile$ = inputFileName$ + outputFileExt$ # Loop through each line for iLine to numLines tempCurrentLine$ = Get string... iLine rIndexOfTab = rindex(tempCurrentLine$, tab$) tempOutLine$ = left$(tempCurrentLine$, (rIndexOfTab-1)) # Do this once more because a tab is at the end of each line rIndexOfTab2 = rindex(tempOutLine$, tab$) outLine$ = left$(tempOutLine$, (rIndexOfTab2-1)) fileappend 'subFolderToProcess$'\'outFile$' 'outLine$''newline$' endfor #Remove #### END OF SCRIPT ####