I am fairly new to Snowflake and am trying to export data from CSV files into a snowflake schema, but I am a bit lost. There’s 5 CSV files in a folder, and I have to use an internal tool to export the data from all 5 files into a table in a Snowflake schema. I have the reading files portion done, but it’s the loading part I’m stuck at.
One, how do I know which data is from which file if I just load the data from all the files into one table? Two, the structure of the files is different than the structure of the schema.
The Snowflake table structure Has the following columns : City File_Name Year Value
The files have the following structure: 1999 Albuquerque 6.5
The first column has no header. The years are the headers starting from the second header. My plan so far is to load the data into a staging table, Alias the first column as ‘City’ and unpivot the year/value data.
I would appreciate any help on how to accomplish this or alternative ideas!