zoukankan      html  css  js  c++  java
  • 导入csv

    void importxls()

    {

        #AviFiles

        str                                 s,tempStr;

        int                                 i,cnt,fieldCount;

        container                           c,conFilter = ["Excel Files(*.csv)", "*.csv"];

        NJ_MF_RouteNumber                   routeNumber;

        SysOperationProgress                progress = new SysOperationProgress();

        TextBuffer                          textBuffer  = new TextBuffer();

        ;

        s = WinAPI::getOpenFileName(0, conFilter, "","Open File", "", "");

        if(s)

        {

            textBuffer.fromFile(s);

            cnt = textBuffer.numLines();

            c = str2con(textBuffer.nextToken(),",");

            progress.setCaption("Data Import");

            progress.setAnimation(#AviFormLetter);

            startLengthyOperation();

            for (i=0;i<cnt;i++)

            {

                progress.setText(strfmt("Reading records %1", i));

                c = str2con(textBuffer.nextToken(),',');

                ttsbegin;

                routeNumber.Field1 = conpeek(c,1);

                routeNumber.Field2 = conpeek(c,2);

                routeNumber.Field3 = conpeek(c,3);

                routeNumber.Field4 = conpeek(c,4);

                routeNumber.Field5 = conpeek(c,5);

                routeNumber.Field6 = conpeek(c,6);

                routeNumber.Field7 = conpeek(c,7);

                routeNumber.Field8 = conpeek(c,8);

                routeNumber.Field9 = conpeek(c,9);

                routeNumber.Field10 = conpeek(c,10);

                routeNumber.RouteNumber = conpeek(c,11);

                routeNumber.Route = conpeek(c,12);

                routeNumber.doInsert();

                endLengthyOperation();

                ttscommit;

            }

        NJ_MF_RouteNumber_Ds.research();

        box::info("µ¼Èë¼Ç¼ÌõÊý£º"+int2str(i));

        }

    }

  • 相关阅读:
    LeetCode 第 193 场周赛
    LeetCode 每日一题 15. 三数之和
    LeetCode 每日一题 739. 每日温度
    [转]邹承鲁院士写他是如何读文献
    LeetCode 每日一题 面试题46. 把数字翻译成字符串
    LeetCode 每日一题 990. 等式方程的可满足性
    传说中编程界的龙书、虎书、鲸书、魔法书…… 指的都是哪些?
    LeetCode 每日一题 238. 除自身以外数组的乘积
    C++ 关键字 explicit
    LeetCode 每日一题 837. 新21点
  • 原文地址:https://www.cnblogs.com/perock/p/2182266.html
Copyright © 2011-2022 走看看