table extraction script