CSV files are the ‘universal ore’ of the digital age. But raw ore is messy. To make it useful, we must pass it through the three stages of the Trinity Forge.
Stage 1: The Scout (Grep)
We begin by removing the slag—empty lines and comments starting with #.
grep -v '^#' raw_data.csv | grep '[a-zA-Z]'
Stage 2: The Sculptor (Sed)
Now we shape the remaining data. We capitalize the first letter of every name and strip the ‘USD’ suffix from the fees column so the machine can read the numbers.
sed 's/\b[a-z]/\U&/g' | sed 's/USD//g'
Stage 3: The Architect (Awk)
Finally, we build the report. We format the columns and calculate the total sum of all fees paid at the bottom.
awk -F, '{sum += $3; print $1 " | ID: " $2 " | Paid: $" $3} END {print "------------------\nTOTAL REVENUE: $" sum}'
The Master Pipeline
By connecting these with the pipe |, we create a single, continuous stream of logic. We don’t save intermediate files; we let the data flow through the heat until it emerges as a finished blade.
Forged in the terminal. Refined under the anvil.