I have a script that uses an input list to pull files from a directory. The file format is unusual so it takes some manipulation and each file is on the order of 60Mb so imports can take more time than I would want. My issue is that most files have the desired header row on row 15 but about 10% of the files have a header that could be anywhere from row 10-14 and there is no way to know until i open the file.
My current solution is to have the script open the first 20 rows, search for the row that contains the headers and assign that row number to a variable, close that dt, then reopen but using the variable as the header and variable + 1 as the first line. It works but it means I'm opening these files twice, though one is a limited preview only.
1) Is there a better way to do this?
2) And while I'm asking, is there a way to import a table but only import the columns that I want, based on name? My files have about 1000 columns and I only need about 15 of them.