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));

        }

    }

  • 相关阅读:
    Castle.Aop.Autofac
    signalR 在webfarm下的配置
    SQL语句中 string类型数字的比较
    access 查询空字段
    c#利用jmail发送邮件
    C# 利用Jmail接收邮件
    Asp.net 使用 AXAJ局部刷新无效的解决方法
    把查询的数据放入多维数组中
    获取网站的根目录的物理文件系统路径
    C#.net如何生成静态页带母板的那种
  • 原文地址:https://www.cnblogs.com/perock/p/2182266.html
Copyright © 2011-2022 走看看