I love Python but do not really care for AWK. For purposes of comparison (and to see how a Python-to-AWK master would do this), could someone rewrite the following Python program in AWK? Considering how short it is, some would think that the rewrite would be simple and easy for anyone with a little time.
import os
ROOT = '/Users/Zero/Documents/MyProgram.app/Contents/TempFiles'
ID = '628251 173511 223401 138276 673278 698450 629138 449040 901575'.split()
def main():
for name in os.listdir(ROOT):
if '.log' in name.lower():
path = os.path.join(ROOT, name)
if os.path.isfile(path):
data = open(path, 'rb').read()
for line in data.split('\r'):
for number in ID:
if number in line:
print line
break
if __name__ == '__main__':
main()