d = dir('**');
Once you have the list, you can loop through them to read your data and write your desired output.
You may also find the fullfile, fileparts, filesep, and exist helper functions handy when processing files like this.
You didn't specify the format of the data in the files, or the desired output format, so if you need more assitance with actually reading and writing the files, you will need to provide more specifics.