How to load a table from a text file and apply algorithm

Hi, I'm new to programming in general and was wondering if anyone knew how to load a table from a text file. I want to do this so I can apply the nearest neighbour algorithm. I'm finding this extremely difficult and there aren't many helpful sources to help.

Thanks, If anyone would be able to guide me i'd be very grateful,



  • Did you look at reference | loadTable()?

    Read the examples for Table (reference as well) to learn how to access cells in the table.

    Eg you might want to for loop over the table

    also there is a tutorial on data

    Please read this

    Post your entire code and tell us where you are stuck (line Numbers)

    Post the first ten lines of your txt file please

  • edited April 2016

    If you have some odd table design in the text file you can:

    then use
    to get the data. Or, if you know specific table entries start with certain char you can use
    to reconstruct the table.

    The first method is good for text file that looks like:

    words and stuff;365;2015;8;23;Friday;Monday
    more words;321;2221;4;22;Wednesday;Saturday

    The second method is good for something like:

    ~row1, entry1 }entry2 spaces don't matter if not split by spaces >entry3 ~row2, entry1 }row2, entry2 >row2, entry3

    loadTable() loads text files that look like:


    I hope that clears that up for you.

Sign In or Register to comment.