Read csv file and append data to redshift
- Set your environment variable to access your redshift database
export REDSHIFT_CONNECTION=redshift://YOUR-USERNAME:YOUR-PASSWORD@YOUR-HOST:YOUR-PORT/YOUR-DB-NAME
- Add your files to csv folder which you want to read and insert data in redshift. Note your file name should match exact name with your table_name on redshift and even columns also.
- After adding type this command
ruby init.rb
- Now it will prompt you to add filename which you want data to read and insert into that.
- Next it will prompt you again for empty complete table and insert from fresh, If you have pressed y so it will delete all record from that table and insert with newly csv data.