Skip to content

Instantly share code, notes, and snippets.

@widoyo
Created February 13, 2013 00:45
Show Gist options
  • Save widoyo/4780246 to your computer and use it in GitHub Desktop.
Save widoyo/4780246 to your computer and use it in GitHub Desktop.
import re
import os, glob
order_num = []
filelist = glob.glob(os.path.join('.', 'feb_*.txt'))
re_order_num = re.compile('Order No: (?P<orderno>\d+)')
for f in filelist:
data = open(f).read()
r = re_order_num.search(data)
if r:
nomor_order = r.groupdict()['orderno']
if nomor_order not in order_num:
order_num.append(nomor_order)
print f, nomor_order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment