I have the file data.txt with two columns and N rows, something like this:
data.txt
0.009943796 0.4667975 0.009795735 0.46777886 0.009623984 0.46897832 0
just add AUC = trapz(X,Y) to your program and you will get the area under the curve