format your code
and post your data file content also formatted
and see my above example how to start with table,
load / read / print
insofar i am not interested in the rest of your code
as long it is not clear what you load and how it is understood.