Automates loading data based on the file extension