1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Const ForReading = 1, ForWriting = 2
Dim MyObject, MyObject2, MyFile
Set MyObject = CreateObject("Scripting.FileSystemObject")
set MyObject2 = CreateObject("ADODB.Stream")
Set MyFile = CreateObject("WScript.Shell")
calc = "C:\OF\calc.csv"
hexfile = "C:\OF\OPT"
Set MyCalc = MyObject.OpenTextFile(calc, ForReading)
Set MyHexFile = MyObject2.OpenBinaryFile(hexfile, ForWriting)
MyCalc2 = MyCalc.ReadAll
ID = split(MyCalc2,vbcrlf)
for i = 1 to 17
cell = split(ID(i),",")
info = cell(6)
infohex = Hex(info)
MsgBox infohex
MyHexFile.Write(infohex,???)
if i = 17 then
exit for
end if
Next
MyHexFile.SaveToFile("C:\OF\OPT2")
MyHexFile.Close() |
Partager