文本文档内容:Name = "EG"
Code = 0000434300003727438274827492832839 \
23782640000000我想把“ \”和回车符去掉,变成:Name = "EG"
Code = 000043430000372743827482749283283923782640000000不知怎样才能实现呢?
Code = 0000434300003727438274827492832839 \
23782640000000我想把“ \”和回车符去掉,变成:Name = "EG"
Code = 000043430000372743827482749283283923782640000000不知怎样才能实现呢?
f=freefile()
s=""
open "a.txt" for input as #f
do
Line input #f,ln
if right(ln,2)=" \" then
s=s+left(ln,len(ln)-2)
else
s=s+ln
debug.printf s
s=""
endif
if eof(f) then exit do
loop
close #f
Open App.Path & "\a_new.txt" For Output As #2Do Until EOF(1)
Line Input #1, strTmp1
If Right(strTmp1, 1) = "\" And Not EOF(1) Then
Line Input #1, strTmp2
strTmp1 = Left(strTmp1, Len(strTmp1) - 1) & strTmp2
End If
Print #2, strTmp1
LoopClose #2
Close #1
Kill App.Path & "\a.txt"
Name App.Path & "\a_new.txt" As App.Path & "\a.txt"
s1=replace(s,vbcrlf,"") '将回车换行符号换为空字串s1=replace(s1,"\","")
replace(s,vblf,"")
replace(s,vblf,"")
replace(s,"\","")
Open App.Path & "\a_new.txt" For Output As #2Do
Line Input #1, strTmp1
If Right(strTmp1, 1) = "\" And Not EOF(1) Then
Line Input #1, strTmp2
strTmp1 = Left(strTmp1, Len(strTmp1) - 2) & strTmp2
End If
Print #2, strTmp1
Loop Until EOF(1)Close #2
Close #1
Kill App.Path & "\a.txt"
Name App.Path & "\a_new.txt" As App.Path & "\a.txt"
本來是想標注修改的地方為紅色字體的,沒想到……
把和去掉就好了。