Creating matrix from folders and subfolders

view story

http://www.unix.com – Hello, Greetings! please help me produce the following solution. I need to produce one big matrix file from several files in different levels. If it helps, the index folder provides information on chromosome index and the data folder provides information on values for chromosomes. there are 2 folders at the same level, index and data. The index folder has multiple files named chr1, chr2 etc. The data folder has many subfolders, Each subfolder has multiple files named chr1, chr2 etc. with the same names as files in the index folder. A particular file and its namesake will have the same num (HowTos)