Back to all templates

CSV Transformation

Trim and reshape CSV exports stored in cloud object storage.

Description:

Retrieves an offices.csv object from AWS S3, reads it into rows, and loops over each row keeping only four selected columns. The reduced rows are collected into a list, written to a new CSV file, and uploaded back to S3 as offices_reduced.csv. The workflow runs on demand.

Key Features:
  • AWS S3 object download and upload
  • CSV parsing with a header row
  • Per-row column projection to a reduced column set
  • In-execution list accumulation of transformed rows
  • CSV regeneration from the accumulated list
Prerequisites:
  • AWS S3 connection with access to the source bucket
  • An offices.csv object stored at key files/offices.csv
Ideal For:

Data teams that need to slim down or reshape CSV exports stored in cloud object storage.

STEPS
  1. Retrieve offices.csv from AWS S3.
  2. Parse the CSV into rows using the header row.
  3. Loop over each row, building an object with only the four selected columns and appending it to a list.
  4. Read the accumulated list back out.
  5. Convert the list into a new CSV file.
  6. Upload the reduced CSV to AWS S3 as offices_reduced.csv.
COMPONENTS
Aws S3
Csv File
Var
CATEGORYDocument Ops

How ByteChef works?

Focus on what matters,
automate the rest.

ByteChef