Thanks guys!!
This is what I was looking for and got my menus are populated dynamically by the number of files in the specific folder!! :)