added end option to getRawData_all.py