1 Reply Latest reply on Apr 3, 2015 9:15 PM by philmodjunk

    import scrip variable file names



      import scrip variable file names



      I have a few hundred *.csv files to import they are all structured the same YYYYdailyXXX.csv where YYYY = year (1982-2014) and XX = site number (001-270).  I wrote and an import script with local variable set for YYYY and XXX but it does not work.  

      Set Variable[$date; Value;"date]

      Set Variable[$stationID;"station.csv"]

      Import Records [No Dialog;"$date"daily"$stationID"]

      Any suggestions for how to make the year and station # variables?

      thanks  Mark

        • 1. Re: import scrip variable file names

          $date appears to be set to the string "date". I usually use a single $Path variable, just seems simpler to set up that way to me.

          You might try using the exploration file that you can download from here: Exploring the use of a $Path Variable in Scripts

          You can use insert file, with the "by reference" check box selected to insert one of these files into a container field. Then you can examine some calculation fields in this database file to see the actual file path to the file. By comparing the resulting file path to what you are calculating, you may spot some minor difference that keeps it from working for you.