module C0::CSV

Defined in:

c0/csv.cr

Class Method Summary

Class Method Detail

def self.from_csv(input : String, group_name : String = "data") : Bytes #

Convert CSV text to C0DATA compact bytes.

The first row is treated as headers, remaining rows as records. The result is a single group (GS + name + SOH headers + RS records).


[View source]
def self.to_csv(buf : Bytes) : String #

Convert C0DATA compact bytes to CSV text.

Expects a buffer containing at least one group with tabular data. Outputs headers (if present) as the first row, then each record.


[View source]