|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
General Scripting - Help with inserting data into a fixed width text file
Hi there
Hoping someone can help. I need to insert 2 leading zeros, only in some instances, into a fixed width text file. Example of text file 94909 999310158177125 EA 24 94909 9977043001639 EA 36 What I need it to look like is 94909 999310158177125 EA 24 94909 990077043001639 EA 36 This is what I have tried but moves all spaces to the right of where the 00 has been inserted Rem Script created: 05.02.2008 14:19 Rem Author: traceyk Const ForReading = 1 Const ForWriting = 2 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objfile = objFSO.OpenTextFile("C:\scripts\pline.txt", ForReading ) strText = objfile.ReadAll objfile.Close strNewText = Replace(strText, "9977","990077 " ) Set objFile = objFSO.OpenTextFile("C:\scripts\test.txt", ForWriting) objFile.WriteLine StrNewText objFile.Close Any help is really appreciated. Thanks TKS |
|
#2
|
||||
|
||||
|
__________________
Click the image if at any point you don't like my decision.Scripting problems? Windows questions? Ask the Windows Guru! |
![]() |
| Viewing: ASP Free Forums > System Administration > Windows Scripting > General Scripting - Help with inserting data into a fixed width text file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|