updates data script to work for flatfile or dynamic data