用脚本处理utf8的文本文件
2024-08-26 23:54:54
filename="C:\Users\Administrator\Desktop\soft\x.txt"
filename2="C:\Users\Administrator\Desktop\soft\x.txt" Dim txt
Dim txt2
txt=ReadFromTextFile( filename )
txt=Replace( txt,"xx软件","yy软件" ) WriteToTextFile filename2,txt Set a = CreateObject("Scripting.FileSystemObject")
a.CopyFile "C:\Users\Administrator\Desktop\soft\web.xml","C:\",true msgbox "ok" Function ReadFromTextFile(FileUrl)
dim str
set stm=CreateObject("adodb.stream")
stm.Type='以本模式读取
stm.mode=
stm.charset="UTF-8"
stm.open
stm.loadfromfile FileUrl
str=stm.readtext
stm.Close
set stm=nothing
ReadFromTextFile=str
End Function Sub WriteToTextFile(FileUrl,byval Str)
set stm=CreateObject("adodb.stream")
stm.Type='以本模式读取
stm.mode=
stm.charset="UTF-8"
stm.open
stm.WriteText str
stm.SaveToFile FileUrl ,
stm.flush
stm.Close
set stm=nothing
End Sub
最新文章
- spring data mongodb 配置遇到的几个问题
- STL之序列式容器list与forward_list
- iOS开发init方法解析
- 【代码笔记】iOS-看图听声音
- iOS - 常用的宏定义
- github里的gist是什么意思
- CSS之拖拽1
- 二维码QRCode
- oracle从各个表取得数据保存到另一个表
- Outlook Express 收发邮件出现&;quot;0x800CCC0F&;quot;错误代码解决方法
- python 循环中的else
- jquery 变量和原生js变量的关系
- IIS7.5应用程序池集成模式和经典模式的区别介绍
- C程序第一次作业
- 《Linux就该这么学》第十四天课程
- 第20月第9天 paddlepaddle
- 使用Phar来打包发布PHP程序
- 【php 之获得当前日期以及比较日期大小】
- Vue学习系列---安装
- 【WIN10】VisualStateManager使用說明
热门文章
- Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with
- JreeeChart入门
- 读javascript高级程序设计13-JSON
- centos 非可视化查看已安装的redis
- Top Five Hacker Tools Every CISO Should Understand
- c# windows编程控件学习-1
- VMware Workstation 10.0.4.2249910 CN
- android 拉伸图片
- poj3159 差分约束 spfa
- 2016 - 1 - 23 xml解析 -- 语法简介