Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:求助!有关按文本长度来导入数据。

1楼
baoxyang 发表于:2009/5/16 9:23:00
因在条形码管理中,从条形码读出的数据每行连串的,关键是应如何取得每行中规定长度的字符串,如aaaa11bbb2ddddd,使得数据表行A列为aaaa,B列11,C列为bbb,D列为2,E列为ddddd,以此类推。。。,也就是按不同规定长度读取文本数据。请老大帮忙!
2楼
yangming 发表于:2009/5/16 12:59:00
可以先导入全部数据,然后在另一固定表中分段获取所需的数据
3楼
baoxyang 发表于:2009/5/17 0:44:00

已经知道怎么做了.

4楼
yangming 发表于:2009/5/17 9:09:00
能否将你做好的例子上传,让大家学学?
5楼
baoxyang 发表于:2009/5/17 9:41:00

Dim s As string = FileSys.ReadAllText("d:\data\Chkinu.txt")
Dim Multi As String = s
Dim Values() as String
Values = Multi.split(Chr(10))
dim s1 as string
Dim s2 As String
Dim s3,s4,s5 As String
For Index As Integer = 0 To Values.Length - 1
  s1 = Values(Index)
  s2 = s1.SubString(1,10)
  s3 = s1.SubString(11,20)
  s4 = s1.SubString(31,12)
  s5 = s1.SubString(44,1)

  Tables("表A").Rows(Index)("第一列") = s2
  Tables("表A").Rows(Index)("第二列") = s3
  Tables("表A").Rows(Index)("第三列") = s4
  Tables("表A").Rows(Index)("第四列") = s5

Next

共5 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .05078 s, 2 queries.