Open - change and save AScii in visual Basic problem
-
Hello I've got al little problem converting parts of a record in an ASCii file. In different ascii files with different number of records must position 5 and 6 be convertet to 0 and then it must be saved again. for example : F1C58475 0- B2C58757 0- E9D48747 1- R0A01477 8- Does anyone has an idia how to do this? Tanx Greetings Nahoj
-
Hello I've got al little problem converting parts of a record in an ASCii file. In different ascii files with different number of records must position 5 and 6 be convertet to 0 and then it must be saved again. for example : F1C58475 0- B2C58757 0- E9D48747 1- R0A01477 8- Does anyone has an idia how to do this? Tanx Greetings Nahoj
in.txt F1C58475 0- B2C58757 0- E9D48747 1- R0A01477 8-
'VB script example
const infile = "C:\...\in.txt"
const outfile = "C:\...\out.txt"set fso = CreateObject("Scripting.FileSystemObject")
set tsin = fso.OpenTextFile(infile)
set tsout = fso.CreateTextFile(outfile)
do while(not tsin.AtEndOfStream)
str = tsin.ReadLine
str = mid(str,1,4) & "00" & mid(str,7)
tsout.WriteLine str
loop
tsout.Close
tsin.Closeout.txt F1C50075 0- B2C50057 0- E9D40047 1- R0A00077 8-