- //TODO: args checks...
- transform(argv[1], atoi(argv[2]), atoi(argv[3]), atoi(argv[4]),
- argv[5], argv[6], argv[7], atoi(argv[8]));
- return 0;
+ if (argc < 4) //program name + 3 arguments
+ {
+ printf("Usage: transform ifileName posID posValue [ofileName [nbItems [sep]]]\n \
+ - ifileName: name of by-columns CSV input file\n \
+ - posID: position of the identifier in a line (start at 1)\n \
+ - posValue: position of the value of interest in a line\n \
+ - ofileName: name of the output file; default: out.csv\n \
+ - nbItems: number of series to retrieve; default: 0 (all)\n \
+ - sep: fields separator; default: ','\n");
+ return 0;
+ }
+ else
+ {
+ return transform(argv[1], atoi(argv[2]), atoi(argv[3]),
+ argc > 4 ? argv[4] : "out.csv",
+ argc > 5 ? atoi(argv[5]) : 0,
+ argc > 6 ? argv[6][0] : ',');
+ }