For the SAM CSV format, SAM's weather file reader doesn't care what order the columns are in -- it determines the type of data in the column from the column heading. We did this to make it easier for people to create their own weather files, and for SAM to read different kinds of weather files that have different data. For example, some files have a column for snow data and some do not, and this arrangement makes it possible for SAM to read files with and without that data.
Can you write your application to use the column heading to identify data instead of column order?
Best regards,
Paul.