以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 如何拆分列  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=59060)

--  作者:wumingrong1
--  发布时间:2014/10/29 10:11:00
--  [求助] 如何拆分列
我想将某列拆分成多列,请问公式该怎么写?如下图所示:


图片点击可在新窗口打开查看此主题相关图片如下:360截图20141029101046015.jpg
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2014/10/29 10:12:00
--  
 字符串贴上来。
--  作者:有点甜
--  发布时间:2014/10/29 10:16:00
--  
Dim str As String = "1234ddre=56;sdf3=78;"
Dim reg As new System.Text.RegularExpressions.Regex("(?<=\\=+)[0-9]+(?=;+)")
Dim mc As Object = reg.matches(str)
msgbox(str.SubString(0,4))
msgbox(mc(0).Value)
msgbox(mc(1).Value)

--  作者:wumingrong1
--  发布时间:2014/10/29 11:13:00
--  
我怎么实现当项目中的 “数据”列内容发生变化时;后面相对应的列内容能够自动发生变化?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目9.foxdb


--  作者:有点甜
--  发布时间:2014/10/29 11:22:00
--  

datacolchanged事件

 

If e.DataCol.Name = "数据" Then
    If e.NewValue = Nothing Then
        e.DataRow("设备") = Nothing
        e.DataRow("槽") = Nothing
        e.DataRow("子槽") = Nothing
        e.DataRow("端口") = Nothing
        e.DataRow("外层") = Nothing
        e.DataRow("内层") = Nothing
    Else
        Dim str As String = e.NewValue
        Dim reg As new System.Text.RegularExpressions.Regex("(?<=\\=+)[0-9]+(?=;+)")
        Dim mc As Object = reg.matches(str)
        e.DataRow("设备") = str.SubString(0,4)
        e.DataRow("槽") = mc(0).Value
        e.DataRow("子槽") = mc(1).Value
        e.DataRow("端口") = mc(2).Value
        e.DataRow("外层") = mc(3).Value
        e.DataRow("内层") = mc(4).Value
    End If
End If


--  作者:wumingrong1
--  发布时间:2014/10/29 12:20:00
--  
在导入数据的时候提示出错


图片点击可在新窗口打开查看此主题相关图片如下:360截图20141029121856984.jpg
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2014/10/29 14:16:00
--  

 你导入的数据显然不规范

 

If e.DataCol.Name = "数据" Then
    If e.NewValue = Nothing Then
        e.DataRow("设备") = Nothing
        e.DataRow("槽") = Nothing
        e.DataRow("子槽") = Nothing
        e.DataRow("端口") = Nothing
        e.DataRow("外层") = Nothing
        e.DataRow("内层") = Nothing
    Else
        Dim str As String = e.NewValue
        Dim reg As new System.Text.RegularExpressions.Regex("(?<=\\=+)[0-9]+(?=;+)")
        If mc.Count = 5 Then
            Dim mc As Object = reg.matches(str)
            e.DataRow("设备") = str.SubString(0,4)
            e.DataRow("槽") = mc(0).Value
            e.DataRow("子槽") = mc(1).Value
            e.DataRow("端口") = mc(2).Value
            e.DataRow("外层") = mc(3).Value
            e.DataRow("内层") = mc(4).Value
        End If
    End If
End If


--  作者:wumingrong1
--  发布时间:2017/2/4 16:05:00
--  

如何把【客户地址】列进行分列?我的命令该怎么修改?

 

客户地址

惠州市/惠城区/江北街道//惠州大道片区/骆屋村70号/101

 

一级地址      二级地址       三级地址       四级地址     五级地址           六级地址            七级地址

惠州市        惠城区          江北街道                        惠州大道片区     骆屋村70号         101

 

 

If e.DataCol.Name = "客户地址" Then
    If e.DataRow("客户地址") = Nothing Then
        e.DataRow("一级地址") = Nothing
        e.DataRow("二级地址") = Nothing
        e.DataRow("三级地址") = Nothing
       e.DataRow("四级地址") = Nothing
        e.DataRow("五级地址") = Nothing
        e.DataRow("六级地址") = Nothing
       e.DataRow("七级地址") = Nothing
       
    Else
        Dim str As String = e.NewValue
        Dim reg As new System.Text.RegularExpressions.Regex("(?=/)[*]")
        Dim mc As Object = reg.matches(str)
        If mc.Count = 6 Then
            e.DataRow("一级地址") = str.SubString(0,2)
            e.DataRow("二级地址") = mc(0).Value
            e.DataRow("三级地址") = mc(1).Value
            e.DataRow("四级地址") = mc(2).Value
            e.DataRow("五级地址") = mc(3).Value
            e.DataRow("六级地址") = mc(4).Value
            e.DataRow("七级地址") = mc(5).Value
        Else
           
           
        End If
    End If
End If


--  作者:有点色
--  发布时间:2017/2/4 16:07:00
--  

 参考

 

http://www.foxtable.com/webhelp/scr/0245.htm

 


--  作者:wumingrong1
--  发布时间:2017/2/4 16:13:00
--  
能不能按8楼的命令帮我修改一下?我需要把分列的内容填写到指定的对应单元格中