写EXCEL(csv 可以用EXECEL打开,逗号分列隔符)

FILE *file = NULL;
    char path[]="D:\\Data\\Pos.csv";
    
    CTime m_tDateTime;   
    m_tDateTime = m_tDateTime.GetCurrentTime();
    CString strTime = m_tDateTime.Format("%Y-%m-%d %H:%M:%S");

    if (NULL != (file=fopen(path,"a")))
    {
        fprintf(file,"%.3f,%.3f,%s",x,y,bexg?"\n":"");
    }

    if(file != NULL)
        fclose(file);

 

posted on 2015-07-09 16:59  strangeman  阅读(463)  评论(0编辑  收藏  举报

导航