Counting the number columns in Excel

How do we write the logic of  counting the number of columns in excel sheet which has been imported via excel importer?
1 answers

As far as I know, in order to do an excel import, you need to have an import template in place. And to create an import template you need to know the number of columns that you are going to import from that excel.

So, what is your use case here?