1.

Solve : Extracting text using the findstr command?

Answer»

Good day.

I need help GETTING some information from a file in a FOLDER on a computer running windows 2003 server operating system. The file looks like the extract below.

13:29:11 ->  START
13:29:12  0000000000000000
13:29:21 POLL ACCEPTED
13:29:33 NUMBER 900000 ACCEPTED
13:29:33   ACCDBA
13:29:37  REPLY NEXT 100  2089
13:29:37  8000070000,  7000
13:29:71 PAPER : 09000000
13:29:71 PAPER 1:1,9;
13:29:79 PAPER PRESENTED
    20\10\10     13:29     ABC0193
1237500321339   9019    719353
          900000
FROM MACHINE
----------------------------------------
13:29:79 PAPER TAKEN
13:29:57 TAPE(0000000000000000) TAKEN
13:29:59 <-  END
13:32:29 ->  START
13:32:29  0000000000000000
13:32:37 POLL ACCEPTED
13:32:77   ACABDA
13:32:75  REPLY NEXT 101  5000
13:32:79  8000070000,  7000
    20\10\10     13:33     ABC0193
1237505090908   9017    132192

FROM MACHINE
        83379
         72879
----------------------------------------
13:32:59 TAPE(0000000000000000) TAKEN
13:32:58 <-  END
13:39:17 ->  START
13:39:15  0000000000000000
13:39:27 POLL ACCEPTED
13:39:29   ACCABB
13:39:33  REPLY NEXT 100  2089
13:39:33  8000070000,  7000
13:39:37 PAPER : 10000000
13:39:37 PAPER 1:1,10;
13:39:72 PAPER PRESENTED
    20\10\10     13:39     ABC0193
1237505939999   9018    990372
         1000000
FROM MACHINE
----------------------------------------
13:39:77 PAPER TAKEN
13:39:79 TAPE(0000000000000000) TAKEN
13:39:51 <-  END
13:77:31 ->  START
13:77:31  11110227127752782
13:77:72 POLL ACCEPTED
13:77:78   ABABAA
13:77:51  REPLY NEXT 101  5000
13:77:52  8000070000,  9000
    20\10\10     13:75     ABC0193
11110227127752782   9019   

FROM 2322
         9009
          9009
----------------------------------------
13:75:05 POLL ACCEPTED
13:75:11   ABABAB
13:75:12  REPLY NEXT 101  5000
13:75:13  8000070000,  9000
    20\10\10     13:75     ABC0193
11110227127752782   9020   

FROM 7099
      2903772
       2903772
----------------------------------------
13:75:23 POLL ACCEPTED
13:75:35   ACDDAB
13:75:35 INTERACTIVE  REPLY
13:75:39  REPLY NEXT 100  2089
13:75:70  8000070000,  9000
13:75:72 PAPER : 02000000
13:75:72 PAPER 1:1,2;
13:75:78 PAPER PRESENTED
    20\10\10     13:75     ABC0193
11110227127752782   9021   
          200000
FROM 7099             10000
      2393772
       2393772
----------------------------------------
13:75:50 PAPER TAKEN
13:75:59 TAPE(0000022712775278) TAKEN
13:75:58 <-  END

I can use the DOS find command to pick out the four digit number under ABC0193 for example 9020. The problem I have is that I want all the information from the line that contains with POLL ACCEPTED before 9020 to the line after 9020 that contains POLL ACCEPTED. In this case I want to extract the text below.

13:75:05 POLL ACCEPTED
13:75:11   ABABAB
13:75:12  REPLY NEXT 101  5000
13:75:13  8000070000,  9000
    20\10\10     13:75     ABC0193
11110227127752782   9020   

FROM 7099
      2903772
       2903772
----------------------------------------
13:75:23 POLL ACCEPTED

Thanks for any help given to me.
   No need to Double Post...it doesn't produce faster results.

Topic CLOSED.



Discussion

No Comment Found