以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 按条件取值填充 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=111502) |
||||
-- 作者:zoyong -- 发布时间:2017/12/23 9:48:00 -- 按条件取值填充 按条件取值
导入交易详细信息内容后,自动获取列中“用途“关健字后面的内容,并删除前面的(日期)和(网银转账,有误即退)的字段 获取内容后粘贴到用途列,并按用途列最后3个字的内容,如果这3个字的内容是(工程款,材料费,税金)等字段,取值填入类别列
[此贴子已经被作者于2017/12/23 9:50:48编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2017/12/23 10:24:00 -- datacolchanged事件 If e.DataCol.Name = "交易详细信息" AndAlso e.NewValue > "" Dim arr() As String = e.NewValue.replace(vbcr,"").split(vblf) Dim str() As String = {"税金","投保金","材料款","工程款","生活费","投标费"} For Each a As String In arr If a.StartsWith("用途") Then Dim idx As Integer = a.IndexOf("(") If idx = -1 Then idx = a.Length Dim s As String = a.SubString(2,idx-2).Trim For Each f As String In str If s.EndsWith(f) Then e.DataRow("类别") = f s = s.SubString(0,s.Length - f.Length) Exit For End If Next e.DataRow("用途") = s Exit For End If Next End If |
||||
-- 作者:zoyong -- 发布时间:2017/12/23 16:32:00 -- 蓝老师,有点点小问题 原内容
交易日期: 2017-12-22 交易时间: 13:38:22 交易网点: 仙居联社营业部 操作员: 999S600 交易渠道: 网银 摘要: 汇出 用途: 嵊州市2017年三界镇车骑山村和介绍信( 假如“用途”后面有冒号,提取后的内容为“: 嵊州市2017年三界镇车骑山村和” 我想提取后的内容是“嵊州市2017年三界镇车骑山村和” 代码: If e.DataCol.Name = "交易详细信息" AndAlso e.NewValue > "" Dim arr() As String = e.NewValue.replace(vbcr,"").split(vblf) Dim str() As String = {"税金","投保金","履约金","材料款","工程款","租赁","劳务","投标费","保函","介绍信","经营费用","管理费用","财务费用","工资福利"} For Each a As String In arr If a.StartsWith("用途") Then Dim idx As Integer = a.IndexOf("(") If idx = -1 Then idx = a.Length Dim s As String = a.SubString(2,idx-5).Trim For Each f As String In str If s.EndsWith(f) Then e.DataRow("类别明细") = f s = s.SubString(0,s.Length - f.Length) Exit For End If Next e.DataRow("用途") = s Exit For End If Next End If |
||||
-- 作者:有点蓝 -- 发布时间:2017/12/23 16:45:00 -- 编辑器第一行加上3个单引号 \'\'\' If e.DataCol.Name = "交易详细信息" AndAlso e.NewValue > "" Dim arr() As String = e.NewValue.replace(vbcr,"").split(vblf) Dim str() As String = {"税金","投保金","履约金","材料款","工程款","租赁","劳务","投标费","保函","介绍信","经营费用","管理费用","财务费用","工资福利"} For Each a As String In arr If a.StartsWith("用途") Then Dim idx As Integer = a.IndexOf("(") If idx = -1 Then idx = a.Length Dim s As String = a.SubString(2,idx-5).Trim().Trim(":") For Each f As String In str If s.EndsWith(f) Then e.DataRow("类别明细") = f s = s.SubString(0,s.Length - f.Length) Exit For End If Next e.DataRow("用途") = s Exit For End If Next End If |
||||
-- 作者:zoyong -- 发布时间:2017/12/23 16:57:00 -- 老师,还是错误
[此贴子已经被作者于2017/12/23 17:01:20编辑过]
|
||||
-- 作者:zoyong -- 发布时间:2017/12/23 17:02:00 -- 还是错误 |
||||
-- 作者:有点蓝 -- 发布时间:2017/12/23 17:04:00 --
|