Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 1
    $\begingroup$ See Put and PutAppend $\endgroup$ Commented Nov 20, 2014 at 12:18
  • $\begingroup$ Related: "The best way to construct a function with memory." $\endgroup$ Commented Nov 20, 2014 at 12:25
  • $\begingroup$ @MariusLadegårdMeyer The PutAppend also seems to overwrite the info, and doesn't solve the import data problem $\endgroup$ Commented Nov 20, 2014 at 12:29
  • 1
    $\begingroup$ @Anoldmaninthesea, try this: (# >>> "test.dat") & /@ {1, 2, 3} followed by ReadList["test.dat"]. For me, this returns {1,2,3}. If you now want to add some new numbers, say (# >>> "test.dat") & /@ {4, 5, 6, 7, 8}, you will find that ReadList["test.dat"] gives you {1,2,3,4,5,6,7,8}. If you only need to save numbers/lists, and not expressions, then this is the simplest way I can think of. $\endgroup$ Commented Nov 20, 2014 at 12:41
  • 1
    $\begingroup$ @Anoldmaninthesea, I can't reproduce that. Did you save it both times with >>>? Try starting from a new file name. $\endgroup$ Commented Nov 20, 2014 at 13:25