Faster way to create tab deliminated text files?

前端 未结 6 988
忘掉有多难
忘掉有多难 2021-02-09 18:01

Many of my programs output huge volumes of data for me to review on Excel. The best way to view all these files is to use a tab deliminated text format. Currently i use this chu

6条回答
  •  一整个雨季
    2021-02-09 18:34

    It may be faster to do it this way:

    ofstream output (fileName.c_str());
    for (int j = 0; j < dim; j++)
    {
        for (int i = 0; i < dim; i++)
            output << arrayPointer[j * dim + i] << '\t';
        output << '\n';
    }
    

提交回复
热议问题