I have an n x 2 boxed array that contains an event ID, and a path to an audio .wav file in a folder. The folder also contains several additional audio wave files. Here's a small section of that array:
tstfp ┌──────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │000355│ C:\Nuance\V8.5.0\mrcp\logs\2011\10October\29\00-08-24-vx1prn123-7b42060a_00000d48_4eab43f8_0064_0000\utt02.wav│ ├──────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │000356│ C:\Nuance\V8.5.0\mrcp\logs\2011\10October\29\00-08-24-vx1prn123-7b42060a_00000d48_4eab43f8_0064_0000\utt03.wav│ ├──────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │000357│ C:\Nuance\V8.5.0\mrcp\logs\2011\10October\29\00-08-24-vx1prn123-7b42060a_00000d48_4eab43f8_0064_0000\utt04.wav│ ├──────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │000361│ C:\Nuance\V8.5.0\mrcp\logs\2011\10October\29\00-08-24-vx1prn123-7b42060a_00000d48_4eab43f8_0064_0000\utt08.wav│ └──────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ The first column is a text string representing the event number of the event which created two audio files in the directory defined in the second column. Looking at the first row of the matrix, the path in the second column is designating a file named utt02.wav. However, there are actually 2 audio files in that folder with the 02 reference. They are: utt02.wav.gz, & ep_call00000_utt00002.wav.gz. The two files are trimmed and untrimmed audio of the same event. After the original log was created, every audio file was zipped, so all audio files now have an extension of *.wav.gz, though the main filename was not changed. The wildcard * will be either ep_call00000_utt000?? or utt?? where ** is the state number. Also after the log was created, the file paths to the audio files got shortened slightly. The path now starts at 'log' For example, in the folder: 00-08-24-vx1prn123-7b42060a_00000d48_4eab43f8_0064_0000 The example log list shows that there are four events, all in the same folder. Each event created two audio file sin the folder: there are several pairs of audio files, one pair for each event, in the folder: 00-08-24-vx1prn123-7b42060a_00000d48_4eab43f8_0064_0000 Here's a listing of the contents of the folder: utt02.wav.gz NB. Event 000355 ep_call00000_utt00002.wav.gz utt03.wav.gz NB. Event 000356 ep_call00000_utt00003.wav.gz utt04.wav.gz NB. Event 000356 ep_call00000_utt00004.wav.gz utt08.wav.gz NB. Event 000361 ep_call00000_utt00008.wav.gz I want to gather up all of the thousands of audio files that are referenced in the log list from their respective folders, and put them all in one folder. Unfortunately, since most of the file names are replicated over and over, we will need to rename the files with a unique name before moving them. The event number is unique, so we can use that number to uniquely identify the files. Event 000355 utt02.wav.gz => 000355yep02.wav.gz ep_call00000_utt00002.wav.gz => 000355nep02.wav.gz Event 000356 utt03.wav.gz => 000356yep03.wav.gz ep_call00000_utt00003.wav.gz => 000356nep03.wav.gz Event 000357 utt04.wav.gz =>000357.wav.gz ep_call00000_utt00004.wav.gz => 000357nep04.wav.gz Event 000361 utt08.wav.gz => 000361yep08.wav.gz ep_call00000_utt00008.wav.gz => 000361nep08.wav.gz Once the files are renamed, I can put them all in one folder, and the event ID in the filename will keep a referenceto the full event log. The challenge is to build a function that can do file re-naming and moving with minimal explicit looping. Skip ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
