View Single Post
  #11 (permalink)  
Old March 30th, 2004, 02:44 PM
CNewbie CNewbie is offline
Authorized User
 
Join Date: Mar 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok Update, I got past that problem and am to this point:

Code:
#include <fstream>
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

int main()
{ 
    char RawPacket[200];
    int INSLength;
    fstream Log("Log.txt",ios::in);
    fstream Parse("Parsed.txt",ios::out);
    while(!Log.eof()) {
    Log.getline(RawPacket,150);
}
    Parse << RawPacket[00] << RawPacket[01] << " "
          << RawPacket[02] << RawPacket[03] << " "
          << RawPacket[04] << RawPacket[05] << " "
          << RawPacket[06] << RawPacket[07] << " "
          << RawPacket[8] << RawPacket[9] << endl
          << RawPacket[10] << RawPacket[11] << endl;
    INSLength = RawPacket[8,9];
    Log.close(); 
    Parse.close();

return 0;
}
The output is now:

48 40 20 00 39
40


The 4th Byte is stored in "INSLength" so now I have to figure out how to use that to output the right amount of bytes with 16bytes per line.

Thanks for all the help so far as you can see it is paying off. :)

Reply With Quote