Új hozzászólás Aktív témák

  • artiny

    őstag

    CSV fájl szétdarabolása strtok () függvény segítségével?
    Ilyan adat szerepel a csv fájlban.

    akcia;action;0;0
    autobus;bus;0;0
    budova;building;0;0
    celkom;quite;0;0
    centrum;centre;0;0

    ezt csv fajlban hogyan kell szetdarabolni?

    Beolvasas a csv fájlnak és szetdarabolas majd kiiratas..hogyan kéne?

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    int main() {

    FILE *doo = fopen("slovnik.csv", "r");

    fclose(doo);

    return 0;
    }

    Strtok()

    Example:

    char str[] = "now # is the time for all # good men to come to the # aid of their country";
    char delims[] = "#";
    char *result = NULL;
    result = strtok( str, delims );
    while( result != NULL ) {
    printf( "result is "%s"\n", result );
    result = strtok( NULL, delims );
    }

    OUTPUT:
    result is "now "
    result is " is the time for all "
    result is " good men to come to the "
    result is " aid of their country"

Új hozzászólás Aktív témák