csv:shrink

Removes specified columns from a CSV file to reduce its width

Options

NameTypeDescription
input_filestringPath to the source CSV file
output_filestringPath for the output CSV file with columns removed
drop_columns[]stringList of column names to remove from the output
original_filestringOriginal CSV file used when merging translated content back
translated_filestringTranslated CSV file used when merging translated content back
headerboolWhen true, the first row is treated as a header

Outputs

NameTypeDescription
output_filestringOutputFile path of the output file
dropped_columnsintNumber of columns removed
remaining_columnsintNumber of columns remaining in the output
total_recordsintNumber of data rows in the output

Example

name: Drop internal columns from a CSV
actions:
  - name: shrunk
    component: csv:shrink
    vars:
      input_file: articles.csv
      output_file: articles-public.csv
      drop_columns:
        - internal_notes
      header: true

outputs:
  file: "{{ shrunk.output_file }}"