I\'m on windows dos prompt. I have log file which contains log like:
Timestamp: Order received for Item No. 26551
Timestamp: Exception: OutOfRangeException
T
If you can download tools, here's a Ruby for Windows command you can use.
C:\work>ruby -ne "print gets.split.last if /Exception/" file
23423
C:\work>type file
Timestamp: Order received for Item No. 26551
Timestamp: Exception: OutOfRangeException
Timestamp: Message: Inventory Item is not stock. Item No. 23423
Timestamp: Order received for Item No. 23341
C:\work>ruby -ne "print gets.split.last if /Exception/" file
23423