易表在线答疑技术与交流用户社区 → [求助]一个关于txt文件中的么中格式转换至易表中指定格式?


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

主题:[求助]一个关于txt文件中的么中格式转换至易表中指定格式?

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


加好友 发短信
等级:超级版主 帖子:13147 积分:-89 威望:0 精华:0 注册:2006/8/11 11:14:00
  发帖心情 Post By:2009/11/19 15:52:00 [显示全部帖子]

将文本文件命名为“ab”,保存于易表文件同一目录下。
表1窗口自定义按钮公式:

CreateGrid(".","a",0,"b",0,"c",0) And
OpenGrid(grids) And
ImportTextFile(docdir+"ab.txt",char(9),Char(13),0) And
OpenGrid("表1") And
ClearGrid(grid) And
AddRows(grid,CountFor("表2","第一列","Instr","@")-1) and
evalfor(grids,"b","Split([a],"":"",1)") And
evalfor(grids,"c","Split([a],"":"",2)") and
evalfor(grid,1,"FindText(grids,""a"",""a"",""Instr"",""@"",row)") and
evalfor(grid,2,"FindText(grids,""c"",""b"",""="",""土地使用者名称"",row)") and
evalfor(grid,3,"FindText(grids,""c"",""b"",""="",""土地坐落"",row)") And
evalfor(grid,4,"FindText(grids,""c"",""b"",""="",""土地等级"",row)") And
evalfor(grid,5,"FindText(grids,""c"",""b"",""="",""宗地面积"",row)") And
evalfor(grid,6,"FindText(grids,""c"",""b"",""="",""建筑占地面积"",row)") And
evalfor(grid,7,"FindText(grids,""c"",""b"",""="",""地籍号"",row)") And
RemoveGrid(grids)


 回到顶部
帅哥哟,离线,有人找我吗?
Czy
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13147 积分:-89 威望:0 精华:0 注册:2006/8/11 11:14:00
  发帖心情 Post By:2009/11/19 16:35:00 [显示全部帖子]

公式第六行公式引用错误。

CreateGrid(".","a",0,"b",0,"c",0) And
OpenGrid(grids) And
ImportTextFile(docdir+"ab.txt",char(9),Char(13),0) And
OpenGrid("表1") And
ClearGrid(grid) And
AddRows(grid,CountFor(grids,"a","Instr","@")-1) and
evalfor(grids,"b","Split([a],"":"",1)") And
evalfor(grids,"c","Split([a],"":"",2)") and
evalfor(grid,1,"FindText(grids,""a"",""a"",""Instr"",""@"",row)") and
evalfor(grid,2,"FindText(grids,""c"",""b"",""="",""土地使用者名称"",row)") and
evalfor(grid,3,"FindText(grids,""c"",""b"",""="",""土地坐落"",row)") And
evalfor(grid,4,"FindText(grids,""c"",""b"",""="",""土地等级"",row)") And
evalfor(grid,5,"FindText(grids,""c"",""b"",""="",""宗地面积"",row)") And
evalfor(grid,6,"FindText(grids,""c"",""b"",""="",""建筑占地面积"",row)") And
evalfor(grid,7,"FindText(grids,""c"",""b"",""="",""地籍号"",row)") And
RemoveGrid(grids)


 回到顶部
帅哥哟,离线,有人找我吗?
Czy
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13147 积分:-89 威望:0 精华:0 注册:2006/8/11 11:14:00
  发帖心情 Post By:2009/11/19 16:36:00 [显示全部帖子]

下面引用由低智商2009/11/19 04:26pm 发表的内容:
版主你好!
测试公式了,效果是只有一行记录进去,:后的循环数据没有出现,也就是第二。。。。。。没有写入

如果你是那个8350,这种公式的错处应该看的出来才对。


 回到顶部