Skip to content

Data Processing — CSV Pipeline

This example walks through a complete data-processing workflow: reading a CSV file, splitting it into a matrix, extracting columns, and computing summaries.

The task

Given a CSV file of sales data, compute the total and average per product.

Reading the file

#import $:io:nread
#import $:str:v2m

raw  nread '/tmp/sales.csv'
data  ',' v2m raw

Extracting columns

⍝ TODO: complete with From + Rank column selection examples

Computing summaries

⍝ TODO: reduce, rank-1 operations on extracted columns

Key techniques used

  • File I/O with the standard library
  • v2m for splitting delimited text into a matrix
  • From + Rank for column extraction
  • Reduce for aggregation