>if (check for match 1) >{ > routine 1 or call routine 1 here; >} >else if (check for match 2) >{ > routine 2 or call routine 2 here; >} >... >else if (check for match 11) >{ > routine 11 or call routine 11 here; >} >else >{ > invalid file type encountered; >} >>And you could also have a method that takes an int or string that coincides with the file types and use the switch construct there and just call that method from the above code.