讀入txt後可以顯示出來,但是輸出txt都是空白
我想上圖輸出txt 內容變成下圖那裡
程式是那裡有問題,一直無法達到目的
可以幫我看一下要如何修改
dim j,c,s
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\new\126.txt", 1)
strContents = objFile.ReadAll
Do While objFile.AtEndOfStream = False
j=left(strContents,32)
c=right(strContents,5)
s=j&c
Loop
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.CreateTextFile("d:\new\125.txt", True)
file.WriteLine (s)
試試看
dim j,c,s
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.CreateTextFile("d:\new\125.txt", True)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\new\126.txt", 1)
Do Until objFile.AtEndOfStream
strContents = objFile.ReadLine
j=left(strContents,32)
c=right(strContents,5)
s=j&c
file.WriteLine (s)
Loop
objFile.Close
file.Close