Interrupt raw data

Interrupt raw data

3
NewbieNewbie
3

    Jan 14, 2006#1

    I want to know if it possible to use ultraEdit to analyze some raw data (a communication trace) in a text file.

    e.g.
    data1 bitmap1 bah bah bah
    data2 bitmap2 bah bah
    data3 bitmap3 bah bah bah...

    Let say if I want to interrupt data2 (line2), I put the cursor to line2, activate a macro and/or a vbscript and then it will format the data according to the bitmap.

    Any suggestion? Thanks in advance!

    6,688586
    Grand MasterGrand Master
    6,688586

      Jan 14, 2006#2

      More details, please! How exactly looks or input data and what should be done with UltraEdit?
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Jan 14, 2006#3

        Mofi,

        Thank you for asking!!

        I want to decode some traces from the applications. Some information (communication dump) look like this:

        06-01-11 19:45:21 - 0 TCP_MNAC : IP msg received - vcid 4
        .0301010}`X@094037540004A0000010015.... ...117x.1

        06-01-11 19:48:08 - 0 TCP_MNAC : IP msg received - vcid 4
        .0399800h@]h09403754@0000000117x001000000020.... ...253.!

        In this example, if I translate the message myself, it read like this:

        For the first message:
        Start of message (1 byte): . (hex 02)
        Application Code (2 bytes): 03
        Message Type (4 bytes): 0101
        More Byte (1 byte): 0
        Bit Map (4 bytes): }`X@ (hex 7D605840)
        (bit 0111 1101 0110 0000 0101 1000 0100 0000)
        Terminal Id: (8 bytes): 09402754
        Seq number: (4 bytes): 0004
        WCC: (1 byte): A
        ..
        ..
        So on

        For the second message:
        Start of message (1 byte): .(hex 02)
        Application Code (2 bytes): 03
        Message Type (4 bytes): 9980
        More Byte (1 byte): 0
        Bit Map (4 bytes): h@]h (hex 68405D68)
        (bit 0110 1000 0100 0000 0101 1101 0110 1000)
        Terminal Id: (8 bytes): 09402754
        WCC: (1 byte): @
        ..
        ..
        So on

        The challenge is:
        The existing of fields (after the bitmap) is based on the bitmap. For example, the seq number field does not show in the second message because the 4th bit is '0' in the second message. I think I can write a VB script to decode the message (one at a time, on request). However, I have a problem to invoke the VB script (or a program) and pass the data to it in a quick and simple way.

        The solution I have in mind is:
        Place the cursor in the message that I want to decode. Invoke a macro: the macro will copy the message (let say, the whole line) in the clipboard and pass it to the VB script. But too bad, I don't know how to do it in UltraEdit.

        At this current moment, how it display (a pop up window, or re-format the exiting file) is not important for me.

        Thanks!!

        6,688586
        Grand MasterGrand Master
        6,688586

          Jan 15, 2006#4

          Well, that should be no problem. At menu Advanced click on Tool configuration.

          At the Command Line field enter the path and name to your vbscript or browse to it. And add as parameter to the script %sel%. This special parameter definition is replaced by UltraEdit during start of the vbscript by the current selection.

          At the Working Directory use same path as the vbscript or enter a different one according to your needs.

          At Menu Item Name specify a name for your tool.

          Turn off all save options because the tool does not use the whole currently opened file or any other opened file.

          The capture options must be only set, if your vbscript returns infos on stdout for you.

          The button Advanced gives you additional options like adding an .ico or .bmp icon for your tool for better appearance of your tool in the menu and in the toolbar, if you add this tool to the toolbar.

          Press button Insert to add your tool and then close the tool configuration dialog with button OK.

          So now you can select for example a line except first byte (hex 02) and the line termination CRLF (set cursor to column 2 and press SHIFT+END for selecting rest of the line). Windows command shell does not allow characters lower hex 20 on command lines. After selection click in the menu Advanced on your tool or use CTRL+1 to run your vbscript with the text currently selected.

          If you want a macro for selection and running the tool, simply record your manual selection and tool run once. You can also use a regular expression find for selection before running the tool, if you are only interested on special trace lines.
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Jan 16, 2006#5

            Mofi,

            Your instructions are so clear and helpful.

            Now, I know how to invoke the command with parameters!! I have to work on my VBscript to decode the messages.

            Thanks a lot!!