#n extract TrIO information from a .log file
/^This is TeX, Version 3.141592653/{
   s/^This is.*/\\def\\TrIOeEMnvVfilenames{% password-protected name/p
}
/^\*\*/{
   s/.*/\\TRIOifcase\\TrIOcnt\\TrIOstop{case 0 in auto}%/p
}
/^TrIO >>>/{
   x
   s/}%%/ \\TrIOfile}%/p   
   x
   s/\(.*\)/\\TrIOmessage{\1}%%/
   h
   s/.*: /\\TRIOor\\TRIOdef\\TrIOiocmd{\\/
   s/input/TRIOinput/
   s/INPUT/TrIOcCkPxXtransfer\\TRIOinput/
   s/openin/TRIOaAmNzZopenin/
   s/immediate /TRIOimmediate\\/
   s/openout/TRIObBlOyYopenout/
   /TRIOinput/s/\\TRIOdef/\\TRIOgdef/
   s/%%/%/p
}
/^Please type another input file name/{
   s/.*: /\\TrIOenvinput\\TRIOgdef\\TrIOfile{/
   s/$/ }%/
   x
   H
}
/^\\FilenameOPEN.*=/{
   s/.*=/\\TrIOenvopen\\TRIOdef\\TrIOfile{/
   s/$/}%/
   x
   s/^.*\n//g
   H
}
${
   x
   s/}%%/ \\TrIOfile}%/p
}
$a\
\\TRIOelse\\TrIOstop{unknown case ( \\TrIOcnt) in auto}%\
\\TRIOfi\\TrIOfFLouUexecute}
