snowflake-csv fileformat to read only 2 line and rest of the data

63 Views Asked by At

I have a requirement to create an external table from a csv file data. But, in every file at Row 3 - we will receive a date value, which we need to create as a new column along with the column data from the csv. Wanted to understand how to populate the date value into a new column or we can create different external table on top of first three rows and use it??

CREATE OR REPLACE EXTERNAL TABLE TEST_CSV_TABLE1(
  period VARCHAR AS (value:c1::varchar),
  Good name VARCHAR AS (value:c2::varchar)
  Customer Name VARCHAR AS (value:c2::varchar)
)
WITH LOCATION = @TEST_STAGE
FILE_FORMAT = (TYPE = CSV FIELD_DELIMITER = ',');

The csv data looks below:

enter image description here

0

There are 0 best solutions below