Switch script to count the number of records in a tabular file