Overview:

The Update CSV Column block allows users to efficiently modify an existing CSV file by either updating a designated column with new data or adding a new column altogether.


Inputs & Outputs

I/OFeatureTypeSimple Explanation
inputcsv_file_namefileThe target CSV file that needs modification, which must be in .csv format.
inputcolumn_indexnumberIdentifies the position of the column to update (0 for the first column).
inputhas_headersbooleanIndicates whether the first row contains headers, helping determine how to process incoming data.
inputis_new_columnbooleanSpecifies if the designated column for updating is newly created or has existed previously.
inputcolumn_contentsstring[]New values that will populate into the specified column; each entry aligns with a row in the original CSV.
outputupdated_csv_file_namefileThe resultant new CSV file name generated after incorporating updates or new columns.

Use Cases

Here’s how this block can streamline various tasks:

  • Merging New Data: Suppose you’ve collected additional metrics from an ongoing project and need to integrate these into your existing dataset—this block facilitates seamless merging without losing any previous information.
  • Correcting Errors: If you discover discrepancies within your dataset due to incorrect entries, this tool allows easy corrections by replacing erroneous values in designated columns effectively.
  • Adding Calculated Fields: When analyzing sales data over different periods, you might want to add a calculated “growth rate” field based on other figures—this block enables creating dynamic fields directly linked to your underlying data.

In essence, any scenario requiring updates or enhancements within a CSV can be efficiently handled using the Update CSV Column block!