code: def import_file(self, filepath, filterindex):
          
  
          # Mark content as changed
          post_command_event(self.main_window, self.ContentChangedMsg)
  
          if filterindex == 0:
              # CSV import option choice
              return self._import_csv(filepath)
          elif filterindex == 1:
              # TXT import option choice
              return self._import_txt(filepath)
          else:
              msg = _("Unknown import choice {choice}.")
              msg = msg.format(choice=filterindex)
              short_msg = _('Error reading CSV file')
  
              self.main_window.interfaces.display_warning(msg, short_msg)
docs: Imports external file
  
          Parameters
          ----------
  
          filepath: String
          \tPath of import file
          filterindex: Integer
          \tIndex for type of file, 0: csv, 1: tab-delimited text file