You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An RFC 4180 CSV parser library for hica. Parses comma-separated and delimiter-separated text into typed tables with named column access, filtering, aggregation, and round-trip serialization.
Installation
1. Add the package
hica add csv
hica fetch
This records the dependency in hica.hml and downloads the package into vendor/.
Custom delimiters: tab (TSV), semicolon, or any single-character separator
Header row: optional, has_header: true/false in CsvOptions
Round-trip: serialize a CsvTable back to CSV (or any other delimiter)
Quick start
import "csv"
fun main() {
let input = "name,age,city\nAlice,30,New York\nBob,25,London"
let t = csv_parse(input)
println(csv_pretty(t))
// name | age | city
// ------+-----+---------
// Alice | 30 | New York
// Bob | 25 | London
match csv_get_by_name(t, 1, "city") {
Some(v) => println(v), // London
None => println("not found")
}
}