1 Reply Latest reply on Aug 16, 2010 11:15 AM by schneb

    Save and Load Lists

    schneb Level 1

      I have a very long list that I have successfully saved to an external text file. The problem is, when I try to load it back in as a list, it is a text file. I have solved this by a repeat that will load each entry into the new list, but it is a very slow process. What I would like is a very fast list loader.

       

      Is there any way I can take a simple text file and turn it into a list? For example...

       

      Here is what I have in the saved list

      "Text String 1

      Text String 2

      Text String 3

      Text String 4"

       

      Here is how I want it to load

      fileList = ["Text String 1", "Text String 2", "Text String 3", "Text String 4"]

       

      That way...

      put fileList[4]

       

      will give me...

      -- "Text String 4"

       

      I can save the list as "["Text String 1", "Text String 2", "Text String 3", "Text String 4"]" into the text file if it will make things easier. But it still needs to be converted to a list somehow.

       

      Note: I tried searching for an answer, but most were pretty confusing answers.

       

      Thanks in advance!