First make sure your data is in the correct format: Test the code first with an explicit definition of the data like I did above. Then get the file reading part to read in the data as the explicit format you now know works. If you want to fit {x,y} pairs in the form of a function y=f(x), then you'll have to specify the expression for the function and just one variable {x}. There are however other functions that may suit your need like Fit, Interpolating Function, etc. Check the help.