Karavitis Consulting Karavitis Consulting  
 
   
Awash in a sea of data...

Problem:
A 5 MB raw telemetry stream.
08150815081508150815081508150815081508150815081508150815081508150815081508150815 08150815081508150815081408140813081208110811081008100810081108110811081208120812 08120812081208120812081208120812081208110808080307970791078607840785078907980802 08050806080808090810081108110812081208130813081308130813081408140814081408130813 08130813081308130814081408140814081408140814081408140814081408140814081508150815 08160816081608160817081708160816081608160816081608150815081508150815081508150815
Solution:
A fast, easy scripting application to reformat the data that runs directly from Win98, WinNT or Win2K desktop.
' Write out data.
'----------------
If mychoice = 1 Then
   Set fso = CreateObject("Scripting.FileSystemObject")
   BaseName = fso.GetBaseName(rawfile)
   Set f = fso.OpenTextFile(BaseName & "OUT.txt", 2, True)
   newdate = starting
   f.WriteLine "-- Start of data - " & actual & " values --"
   For i = 1 to actual
      newdate = DateAdd("n", myinterval, newdate)
      f.WriteLine newdate & chr(9) & mid(mytext,(i*4)+1,4)
      Next
   f.WriteLine "-- End of data --"
   f.Close
   MsgBox "New file created: " & BaseName & "OUT.txt", 64
Result:
A formatted ASCII text file ready to import directly into most applications.
Station: Harrison County 53 Parameter: Water Level in Feet
------ Start of data - 119 values ------
7/8/98 16:00 8.15
7/8/98 17:00 8.15
7/8/98 18:00 8.15
7/8/98 19:00 8.15
7/8/98 20:00 8.15
7/8/98 21:00 8.15
7/8/98 22:00 8.15
7/8/98 23:00 8.15
7/9/98 00:00 8.15
7/9/98 01:00 8.15
...
Success!