added function to expand env variables
Added function to add extensions(.dat or .xsm) to filenames