• [^] # Re: J'ai trouvé

    Posté par . En réponse au message try catch et URL sous wxWidgets. Évalué à 2.

    Et ceci (à améliorer) fonctionne pas trop mal pour lire les fichiers CSV.

    bool fgetcsv (wxTextInputStream text, wxString tagfield1, wxString tagfield2, wxArrayString *data)
    {
    wxString token;
    wxString line;
    int i = 0;

    data->Empty();

    line = text.ReadLine();

    if (line)
    {
    wxStringTokenizer tkz(line, tagfield1);
    while ( tkz.HasMoreTokens() )
    {
    token = tkz.GetNextToken();
    token.Replace(tagfield2, "");
    token = token.Trim();
    if (token)
    data->Add (token);
    i++;
    }
    }
    else
    return false;
    return true;
    }