如何按指定内容批量生成txt文件

buya172 2009-05-30 11:25:56
现有excel表格文件如下:

conclusion n.结束, 结尾信念, 意见, 结论
concord n.和谐, 一致, 和睦
concrete adj.实体的, 有形的确实的, 明确的, 确定的
condemn vt.谴责, 责备判罪, 处刑宣布…不能使用迫使…陷于不幸的境地
condense vt.简说, 摘要, 简述 vt. & vi.(使)变稠或变浓; 浓缩(使)凝结
condenser n.冷凝器(尤指汽车发动机内的)电容器
condition n.状况, 状态; vt.制约, 限制使习惯于, 使适应
conditional adj.依赖某事物的有条件的, 受制约的

如何批量生成为txt文档,像这样:
conclusion.txt
concord.txt
concrete.txt
comdemn.txt
condense.txt
condenser.txt
condition.txt
conditional.txt

每个txt文档里面的内容就是对应的单词的意思。

...全文
1348 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
noni945 2009-12-11
  • 打赏
  • 举报
回复
我也需要这个。看看,谢谢
buya172 2009-05-31
  • 打赏
  • 举报
回复
我早就六体投地了,哈,强呀,ljc007 ,啥也不说了,结帖去
janser08 2009-05-31
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 ljc007 的回复:]
1、把你的excel表格文件保存为a.xls

2、把以下代码保存为test.vbs


VB codeset objShell = CreateObject("WScript.Shell")
Set objExcel = CreateObject("Excel.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strThisPath = objShell.CurrentDirectory
Set objWorkbook = objExcel.Workbooks.Open(strThisPath & "\a.xls")
intRow = 1
do until objExcel.Cells(intRow,1).Value = ""…
[/Quote]


哇塞,佩服的五体投地啊~!!!!!!!!!!
我试了下,完全可以。真的是高人啊!!!!!!!!!!!!!!!!
ljc007 2009-05-31
  • 打赏
  • 举报
回复
1、把你的excel表格文件保存为a.xls

2、把以下代码保存为test.vbs

set objShell = CreateObject("WScript.Shell")
Set objExcel = CreateObject("Excel.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strThisPath = objShell.CurrentDirectory
Set objWorkbook = objExcel.Workbooks.Open(strThisPath & "\a.xls")
intRow = 1
do until objExcel.Cells(intRow,1).Value = ""
strResult = strResult & objExcel.Cells(intRow,1).Value & vbCrLf
Set objFile = objFSO.OpenTextFile(objExcel.Cells(intRow,1) & ".txt",2,True)
objFile.WriteLine objExcel.Cells(intRow,2)
objFile.Close
intRow = intRow + 1
loop
objExcel.Quit


3、把a.xls和test.vbs放在同一文件夹下,双击运行test.vbs即可。
buya172 2009-05-30
  • 打赏
  • 举报
回复
补充下,excel里第一列是单词,第二列是词义
fairchild811 2009-05-30
  • 打赏
  • 举报
回复
excel里面宏应该可以实现,不过不会,帮顶。

6,868

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧