fork(1) download
  1. import sys
  2. import re
  3.  
  4. for ln in sys.stdin:
  5. m = re.match(r'^(.*?)\s+on\s+CPU.*(?<=\sCPU)\s+(\d+)\s*$', ln);
  6. if m is not None:
  7. print m.groups();
Success #stdin #stdout 0.08s 10824KB
stdin
some other line here
TrnIq: Thread on CPU 37 
TrnIq: Thread on CPU 37 but will be moved to CPU 44 
IP-Thread on CPU 33 
FANOUT Thread on CPU 37 
Filter-Thread on CPU 38 but will be moved to CPU 51 
TRN TMR Test 2 Supervisor Thread on CPU 34 
HomographyWarp Traking Thread[0] on CPU 26 
stdout
('TrnIq: Thread', '37')
('TrnIq: Thread', '44')
('IP-Thread', '33')
('FANOUT Thread', '37')
('Filter-Thread', '51')
('TRN TMR Test 2 Supervisor Thread', '34')
('HomographyWarp Traking Thread[0]', '26')