What is that format supposed to be? How is it produced?
If you know what format it is supposed to be in then use a reader for that format. If you don’t know then it seems to be json compatible and I’ll just read it as json. In any case, never use include for this.
The lists look exactly like those produced from Python but I think they in fact came from the output of a piece of software called Gap. In any case, I need to read in the files as they are given to me. The main problem is just the carriage returns I think.
Well, readdlm clearly won’t work, and the new line isn’t the problem. You must first identify what format you are dealing with. If you don’t know or if the producer doesn’t specify, then as I said json should work. In any case, just don’t use include.
I think one way in this case is to just input the entire thing as a single string and parse the string yourself. Probably not too bad because you can just split it into chunks by commas, discard the brackets, trim whitespace, and then parse to integer. Some regex wiz can probably do it in 2-3 lines of code.
Thanks. Now I see that JSON.parsefile can’t cope with the large integers. It gives 0 for all the numbers which are too big. This is even before attempting to convert the vector. This file shows the problem http://paste.ubuntu.com/p/pxmwPXkNNk/ . Maybe I should ask a separate question for this aspect?