<s> import sys <EOL> if sys . argv [ <NUM_LIT:1> ] == "<STR_LIT>" : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( ) <EOL> f = open ( sys . argv [ <NUM_LIT:1> ] , '<STR_LIT:rb>' ) <EOL> indxBytes = "<STR_LIT>" <EOL> offset = <NUM_LIT:0> <EOL> byteChunk = "<STR_LIT>" <EOL> recordsFound = <NUM_LIT:0> <EOL> outFile = open ( "<STR_LIT>" , '<STR_LIT:wb>' ) <EOL> print "<STR_LIT>" "<STR_LIT>" "<STR_LIT>" <EOL> while byteChunk != "<STR_LIT>" : <EOL> byteChunk = f . read ( <NUM_LIT> ) <EOL> compare = byteChunk [ <NUM_LIT:0> : <NUM_LIT:8> ] <EOL> if compare . encode ( "<STR_LIT>" ) == indxBytes : <EOL> recordsFound = recordsFound + <NUM_LIT:1> <EOL> outFile . write ( byteChunk ) <EOL> offset = offset + <NUM_LIT> <EOL> if offset % <NUM_LIT> == <NUM_LIT:0> : <EOL> print "<STR_LIT>" % ( ( offset / <NUM_LIT> ) , recordsFound ) <EOL> outFile . close ( ) </s>
