Skip to content

Instantly share code, notes, and snippets.

@waiteb3

waiteb3/csv.zig Secret

Created April 24, 2019 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waiteb3/53587e25a6794244bfd00de01c2f6f0e to your computer and use it in GitHub Desktop.
Save waiteb3/53587e25a6794244bfd00de01c2f6f0e to your computer and use it in GitHub Desktop.
pub fn main() {
const Row = struct {
age: i32,
name: []u8,
};
var contents_from_file = "1,2,3"; // will ignore last colum for now or ERR
var row = parse_csv_line(Row, contents_from_file);
printf(row); // Row { age = 1, name = "2" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment