read_input function

Flexible file import based on extension