Hi all,
A simple VBA question.
I am using (or trying to) an excel macro to read temperatures from a file and output them in a new formatted file. The macro is;
Sub test1()
'
' Format Temperature File
'
FileName1 = "D:\data\temps.inp"
Open FileName1 For Input As #1
Open "D:\data\temps.out" For Output As #3
' Read File reformat and output
Do While Not EOF(1)
Line Input #1, Dummy1
Point1 = Left(Dummy1, 8)
Temp1 = Mid(Dummy1, 10, 21)
Print #3, Val(Temp1)
Print #3, Point1
Loop
Close #1
Close #3
End Sub
I want;
^^^970.031
3000001
^^^934.616
3000002
^^^882.253
3000003
^^^560.491
3000004
^^^575.562
3000005
I get;
970.031
3000001
934.616
3000002
882.253
3000003
560.491
3000004
575.562
3000005
How do I modify the macro to give me what I require.
ie 3 spaces, temperature
0 spaces, point
Thanks for reading. All help gratefully received.
M
Bookmarks