作者在 2015-04-09 00:49:37 发布以下内容
方法一(VFP方法)
Clear
cStr=Strtran(Filetostr("demon.txt"),0h0d0a,"|")
Do While "||"$cStr
cStr=Strtran(cStr,"||","|")
Enddo
=Strtofile(Strtran(Substr(cStr,2),"|",0h0d0a),"demon1.txt")
方法二(正则表达式方法)
clear
local Reg, cStr
Reg = CreateObject("VBScript.RegExp")
cStr=Filetostr("demon.txt")
Reg.Global = .T.
Reg.MultiLine = .T.
Reg.Pattern = "^\s*\n\r"
cStr=Reg.Replace(cStr,"")
Release Reg
Reg=Null
=StrToFile(cStr,"demon1.txt")