¦¹¹Ï¬°¿é¥X¬°txtÀɮ׮ɪº®æ¦¡,»P¿Ã¹õ¿é¥X®æ¦¡¤£¤@P
¤U¬°µ{¦¡½X
n¦p¦ó¦btxtÀɮ׿é¥X»P¿Ã¹õ¿é¥X¤@¼Ë
¥i¥HÀ°§Ú¬Ý¤@¤UÀɮ׿é¥Xµ{¦¡n¦p¦óקï
Set objRegEx = CreateObject("VBScript.RegExp")
Dim arrFileLines()
AAA = ""
i = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\input.txt", 1)
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = "\d{5}"
For l = LBound(arrFileLines) to UBound(arrFileLines)
if l <10 then
strNewString = objRegEx.Replace(arrFileLines(l),"0000" & (l+1) )
AAA = AAA & strNewString & chr(10)
else
strNewString = objRegEx.Replace(arrFileLines(l),"000" & (l+1) )
AAA = AAA & strNewString & chr(10)
end if
next
Wscript.Echo AAA
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("d:\outfile.txt", True)
MyFile.WriteLine(AAA)
MyFile.Close