Is there an option to load a CSV into Redshift with a header? I see the documentation for CSV but it says nothing about a header. Ideally it could use the header to determine the columns to load.
The easiest way to load a CSV into Redshift is to first upload the file to an Amazon S3 Bucket. You can follow the Redshift Documentation for how to do this. After that you can use the COPY command to tell Redshift to pull the file from S3 and load it to your table.
A COPY command is the most efficient way to load a table. You can also add data to your tables using INSERT commands, though it is much less efficient than using COPY. The COPY command is able to read from multiple data files or multiple data streams simultaneously.
Connecting Excel to Amazon Redshift with Microsoft QueryStart Excel, click the Data tab. In the appeared ribbon, click From Other Sources, and then click From Microsoft Query. In the next dialog, choose the data source you want to connect to (e.g., using data source name - Devart ODBC Amazon Redshift).
Use the IGNOREHEADER 1
option when using the COPY
command:
IGNOREHEADER [ AS ] number_rows
Treats the specified number_rows as a file header and does not load them. Use IGNOREHEADER to skip file headers in all files in a parallel load.
See: Amazon Redshift COPY
command documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With