首页 >>  正文

vb替换txt

来源:baiyundou.net   日期:2024-09-21

奚天荣4876VB如何查找替换txt文档中的字符串,是指定路径的txt文档,求程序代码 -
堵转建13144493163 ______ 设置text1的Hideselection属性为false 点查找按钮 dim aa as string 要查找的字符串 if instr(text1.text,aa) then text1.selstart=instr(text1.text,aa)-1 text1.sellen=len(aa) end if 点击替换按钮 text1.seltext="你要替换成什么就写什么"

奚天荣4876VB将txt文件中所有"?"替换成换行符 -
堵转建13144493163 ______ Private Sub Command1_Click() p = "c:\vb.txt" '改成你的文件路径 Dim inp, temp As String Open p For Input As #1 Do While Not EOF(1) Line Input #1, inp inp = Replace(inp, "?", vbCrLf) temp = temp & inp & vbCrLf Loop Close #1 Open p For Output As #1 Print #1, temp Close #1 End Sub

奚天荣4876VB求助:用text.text的字符串内容替换TXT文本文件里的特定字符,代码怎么写? -
堵转建13144493163 ______ 分别替换什么?都是$SYS$么?先说说分别替换的原理 a = Split(Text1.Text, vbCrLf) For i = 0 To UBound(a) Print a(i) '分别取得文本框各行内容,以便用来替换指定内容 Next 下面只是替换$SYS$,分别替换建议楼主另开一个30分的帖子,也只是...

奚天荣4876VB高手,请问如何将txt内的内容互换? -
堵转建13144493163 ______ On Error Resume Next Dim a As String Dim s As String Dim ss() As String Open "D:\B\vu\t1.txt" For Input As #1 Open "D:\B\vu\t2.txt" For output As #2 Do Until EOF(1) Line Input #1, s ss = Split(Trim(s)," ") a=ss(1) ss(1)=ss(2) ss(2)=a s=join(ss," ") print #2,s Loop Close #1 close #2 转换后的文件是t2.txt

奚天荣4876vb 文本替换 -
堵转建13144493163 ______ 下面的代码是假设你的文本指的是text1但要是你说的文本是txt,就用input读取到text1,最后完成替换后用output写入到原txt文件内就行了```` Private Sub Command1_Click() s = Split(Text1, vbCrLf) Text1 = "" For i = 0 To UBound(s) If i < 2 Then ...

奚天荣4876vb修改txt指定字符 -
堵转建13144493163 ______ dim s() as string,ss() as string open "d:\123.txt" for binary as #1 s=split(input(lof(1),#1),vbcrlf) close #1 ss=split(s(6),":") 's(6)是第7行 ss(4)=text2.text '第4个冒号和第5个冒号间的内容替换为text2的内容 s(6)=join(ss,":") kill "d:\123.txt" open "d:\123.txt" for binary as #1 put #1,,join(s,vbcrlf) close #1

奚天荣4876如何用VB批量更改文件夹中的所有txt文件 -
堵转建13144493163 ______ Private TxtName() As String '定义一个数组装入txt名称Dim sPath As StringSub GetTxtName(ByVal sPath As String, ByVal Filter As String) '这是获取指定文件夹下...

奚天荣4876vb实现将txt中所有"?"替换成换行符 -
堵转建13144493163 ______ Private Sub Command1_Click() Dim temp$ Dim temp1$ Open App.Path & "\技术.txt" For Input As #1 Open App.Path & "\技术.tmp" For Output As #2 Do While Not EOF(1) Line Input #1, temp If temp Like "*?*" Then temp1 = "" '清除它的...

奚天荣4876VB6.0 txt查找某个字符然后替换 -
堵转建13144493163 ______ 给你一个方法吧.是读取整个文件的.Public Function File_get_contents(path As String, Optional Unicode = "GB2312") Dim arrBinary() As Byte Open path For Binary As #1 ReDim arrBinary(LOF(1) - 1) Get #1, , arrBinary() Close #1 File_get_...

奚天荣4876在VB中怎么实现 把输入的文字 另外保存为TXT文档? -
堵转建13144493163 ______ 下面是两个函数你可以 学习一下 文件的基本 读 写 你要查看要 open 的功能 如果会了 你的问题就不是问题了''' 功能 读取文本文件 返回文本文件的字符串 参数 filepath 为 文件路径 Function ReadTxtFile(FilePath As String) As String If Len(Dir(...

(编辑:自媒体)
关于我们 | 客户服务 | 服务条款 | 联系我们 | 免责声明 | 网站地图 @ 白云都 2024