读取CSV文件

CommaTextIO m_CSVFile;
    container   m_con;
    InventTable m_inventTable;
    int         i;
    #File
    ;
    m_CSVFile = new CommaTextIO("C:\Users\JSZhang1002\Desktop\Data\Items.csv", #io_read);
    if (!m_CSVFile || m_CSVFile.status() != IO_Status::Ok)
        throw error("访问磁盘失败。");
    while (m_CSVFile.status() == IO_Status::Ok)
    {
        m_con = m_CSVFile.read();
        if (m_con != connull())
        {
            info(strFmt("itemID: %1, itemName: %2 ",
                conpeek(m_con,1),conpeek(m_con,2)));
        }
    }

原文地址:https://www.cnblogs.com/KobeZhang/p/4427842.html