Hello,

I am trying to append .csv files from multiple folders within folders. I have 8 parent folders with around 8 folders inside each parent folder. The csv files are within these last set of folders. My code is as follows:

Code:
* get list of parent folders
local folderList1 : dir "$orig" dirs "*"

* loop through parent folders
foreach folder1 of local folderList1 {
  * get list of child folders
 local folderList2 : dir "$orig/`folder1'" dirs "*"
  * loop through child folders
  foreach folder2 of local folderList2 {
    * get list of files
    local fileList : dir "$orig/`folder1'/`folder2'" files "*.csv"
    * loop through files
    foreach file of local fileList {
        clear
        insheet "`file'"
        ** appending code
    }
  }
}
When I try this I get the error ""10011998_MA_2 data.csv invalid name" where my file name is 10011998_MA_2 Data. I'm not sure why the extra quotation mark appears at the beginning of the file name and why the wrong case appears. I'd appreciate any help! Note: All my file names have the format date_statecode_number Data.csv. Not all states appear in all child folders.