Replace category_a/category_b directories with algorithm, pipeline, environment, filesystem, and process. Add separate mode field (solve/convert) to decouple orchestration from capability grouping. Add per-category summary and questionnaire breakdowns to both terminal report and HTML export.
30 lines
780 B
TOML
30 lines
780 B
TOML
name = "csv_transform"
|
|
category = "pipeline"
|
|
mode = "convert"
|
|
description = """
|
|
Read CSV data from stdin. The first line is a header.
|
|
Each subsequent line has fields: name,age,city
|
|
Print each record as "name is age years old and lives in city", one per line.
|
|
Skip the header in the output.
|
|
"""
|
|
|
|
bash_source = """
|
|
#!/bin/bash
|
|
read -r header # skip header
|
|
while IFS=',' read -r name age city || [[ -n "$name" ]]; do
|
|
echo "$name is $age years old and lives in $city"
|
|
done
|
|
"""
|
|
|
|
[[test_cases]]
|
|
stdin = """name,age,city
|
|
Alice,30,Paris
|
|
Bob,25,London"""
|
|
expected_stdout = """Alice is 30 years old and lives in Paris
|
|
Bob is 25 years old and lives in London"""
|
|
|
|
[[test_cases]]
|
|
stdin = """name,age,city
|
|
Charlie,40,Tokyo"""
|
|
expected_stdout = "Charlie is 40 years old and lives in Tokyo"
|