How do I spin through a logfile?

How do I spin through a logfile?

4
NewbieNewbie
4

    Aug 15, 2006#1

    I have a logfile that looks like this:

    Code: Select all

    12:03:24 		20039 DIF has 866 recs, ACK reports 8529
    12:03:24 		20039 GetDIF was unsuccessful
    12:03:24 		20039 End processing 20039
    
    12:03:26 	20040 DIF has 1443 recs, ACK reports 5966
    12:03:27 	20040 GetDIF was unsuccessful
    12:03:27 	20040 End processing 20040
    I need a way to look at each line, looking for "End processing" and then return the 5 digit number after each of these.

    How can I do this?

    6,675585
    Grand MasterGrand Master
    6,675585

      Aug 16, 2006#2

      What do mean with return the 5 digit number?

      Should the number be highlighted, copied to clipboard, copied to a new file, ...?
      Best regards from an UC/UE/UES for Windows user from Austria

      4
      NewbieNewbie
      4

        Aug 16, 2006#3

        In my example, I need to grab the 20039 and the 20040, and put them in a new file. Sometimes the data "12:03:27 20040 End processing 20040" will be offset by about 6 characters, as in this example:

        Code: Select all

        13:30:48 					35050 [PerformanceMeasurement3] starting
        13:30:48 					35050 27355 released stream
        13:30:48 					35050 End processing 35050
        
        13:30:48 		20021 27448 got stream after waiting 0:24:58
        13:30:48 		20021 [ZeroSOF_S] dealer 20021 day is sa, sofwday is tu, zeroS is 0
        13:30:48 		20021 [ParseDIF] Parsing 2002108152006.DIF
        13:30:49 00235 [PerformanceMeasurement3] starting
        13:30:49 00235 27206 released stream
        13:30:49 			20001 27389 got stream after waiting 0:24:58
        13:30:49 00235 End processing 00235

        6,675585
        Grand MasterGrand Master
        6,675585

          Aug 17, 2006#4

          Run an UltraEdit style Regular Expressions search with search string %*End processing +[0-9]+ and with List Lines Containing String enabled. You will see a dialog which contains all lines of interest.

          Click in the dialog on the button Clipboard and close the dialog. Create a new file and paste the lines with Ctrl+V.

          Press Ctrl+Home to move the cursor to top of the new file and run following UltraEdit style Regular Expressions Replace to delete the part before the numbers of interest.

          Find: %*End processing +
          Replace: with nothing
          Best regards from an UC/UE/UES for Windows user from Austria

          4
          NewbieNewbie
          4

            Aug 17, 2006#5

            Thanks a lot. For some reason, when I go to paste the results copied from the find, there are no records, even though the find return some.

              Aug 18, 2006#6

              That's odd. I exited UE and came back in and now I can paste. Oh well, on the second expression, I get the following output:

              12:11:20 35204 35204
              12:11:27 42120 42120
              12:12:03 25188 25188
              12:13:33 20184 20184
              12:14:31 20167 20167
              12:14:54 20065 20065
              12:15:44 20044 20044
              12:15:55 20042 20042
              12:16:15 20013 20013
              12:16:46 20005 20005

              All I want is the number

              6,675585
              Grand MasterGrand Master
              6,675585

                Aug 18, 2006#7

                Looks like you do not use the UltraEdit style regular expression engine because this result is produced by the Unix or Perl engine with the UE regular expressions - see Configuration - Search dialog.

                For Unix or Perl use following search strings:

                Find search string: ^.+End processing +\d+
                Replace search string: ^.+End processing +
                Best regards from an UC/UE/UES for Windows user from Austria