#include #include #include using namespace sword; using namespace std; void processLine(SWBuf line) { line += "|"; const char *field = line.stripPrefix('|'); cout << "[" << field << "]\n"; const char *keys[] = { "PointedHeb", "Language", "Meaning", "TWOT", "Form", "GkRelated", "FullerMeaning", "UnpointedHeb", "CALUnpointedAscii", "TABSUnpointedAscii", "Transliteration", "Phonetic", "Notes", "FullMeaning", "TranslationInAV", 0 }; for (int i = 0; keys[i]; i++) { field = line.stripPrefix('|'); if (!field) break; if (!strcmp("PointedHeb", keys[i])) { cout << "UTF8=" << field << "\n"; } else { cout << keys[i] << "=" << field << "\n"; } } } int main(int argc, char **argv) { FileMgr fmgr; SWBuf line; char *fname = "STRONGSLIST.csv"; if (argc > 1) fname = argv[1]; FileDesc *in = fmgr.open(fname, O_RDONLY); while (fmgr.getLine(in, line)) { line.trim(); if (line.length()) { processLine(line); } } fmgr.close(in); return 0; }