标题: [转贴] VBS利用ADODB.STREAM读写UTF8,还有追加写入 [打印本页]
作者: BAT221110 时间: 2022-11-14 19:11 标题: VBS利用ADODB.STREAM读写UTF8,还有追加写入
转载自:https://www.cnblogs.com/waver/articles/1283842.html- FUNCTION READ4(FPATH)
- DIM ADOS
- SET ADOS = CREATEOBJECT("ADODB.STREAM")
-
- WITH ADOS
- .CHARSET = "UTF-8"
- .TYPE = 2
- .OPEN
- .LOADFROMFILE FPATH
- READ4 = .READTEXT
- .CLOSE
- END WITH
- SET ADOS = NOTHING
- END FUNCTION
-
-
- SUB WRITE1291(S1223)
- DIM ADOS
- SET ADOS = CREATEOBJECT("ADODB.STREAM")
-
- WITH ADOS
- .TYPE = 2
- .MODE = 3
- .CHARSET = "UTF-8"
- .OPEN
- .WRITETEXT S1223
- .SAVETOFILE "EXTRACTS221114-2.CSV.TXT",2
- END WITH
- SET ADOS = NOTHING
- END SUB
-
-
-
- SUB APPEND4210321(S1419)
- DIM X
- X = READ4("EXTRACTS221114-2.CSV.TXT")
- WRITE1291 X & VBCRLF & S1419
- END SUB
复制代码
追加写入似乎只能这样实现?
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |