Foxtable(狐表)用户栏目专家坐堂 → [求助]批量txt文本提取


  共有7792人关注过本帖树形打印复制链接

主题:[求助]批量txt文本提取

帅哥哟,离线,有人找我吗?
狐狸爸爸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/1/30 17:43:00 [显示全部帖子]

Dim tb1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim mypath As String = tb1.Text
'------------导入订单主表信息------------------提取文件名的内容填入数据.   测试可行!
Dim t As Table = Tables("订单总表")
t.StopRedraw
For Each File As String In FileSys.GetFiles(mypath)
    Dim dr As Row =t.AddNew()
    dr("备注")= File.Replace(file.SubString(file.LastIndexOf("\"),32),("_K" & file.SubString(file.LastIndexOf("\"),28) & "_K.PDF"))
    dr("货号") =file.SubString(file.IndexOf("_")+8,2)
    dr("订单号") =file.SubString(file.LastIndexOf("_")+1,10)
    dr("订单下载日期")= Date.Today()
 '------------导入订单明细表信息------------------提取文件内部内容填入数据   测试不行!
    Dim strs As String = FileSys.ReadAllText(file)
    strs = strs.Replace(vblf, "")
    Dim rs() As String = strs.Split(vbcr)
    For i As Integer = 0 To rs.Length - 1
        Dim cs() As String = rs(i).Split(New Char() {" "c}, System.StringSplitOptions.RemoveEmptyEntries)
         For n As Integer = 0 To cs.length - 1
            messagebox.show( n & ":" & cs(n))
        Next

        exit for
    Next
Next

t.ResumeRedraw()


 回到顶部