Skip to content

Instantly share code, notes, and snippets.

@reportbase
Created March 22, 2015 21:00
Show Gist options
  • Save reportbase/45c5bf8092f0bf345b8e to your computer and use it in GitHub Desktop.
Save reportbase/45c5bf8092f0bf345b8e to your computer and use it in GitHub Desktop.
echo csv file
inline void echo_csv(const char*, const char* path, void* app_, node<message*>** errors)
{
/*
const char* line =
"AAC,20120426\r\n"
"BBB,20120425\r\n";
*/
int linesn;
char** lines = load_file_lines(path, linesn);
for(int n = 0; n < linesn; ++n)
{
int tokensn;
char** tokens = tokenizer(lines[n], '\t', tokensn, PARSE_SKIPBLANKS | PARSE_SKIPCOMMENTS);
printf("%s,", tokens[0]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment