On Tue, Oct 25, 2016 at 4:05 PM, Aleksandr Mikheev <al.mikhee...@gmail.com> wrote: > Hello, sorry if this question have already been asked, but I could not find > a similar thread. So, I have a .dat ("numbers.dat") file, which I should > open. I believe I should do something like this: > >> f = open("numbers.dat") > > > And after that I tried to read it: > >> readlines(f)
read(f, Int64) > > > However, Julia writes the Error: "UnicodeError: invalid character index". My > tutor told me that this is a binary file, so what I need is a binary read, > such as fread in C/C++. I tried to read the documentation, tried to google, > but still cannot understand what should I do. Also, a quote from my tutor, > which can probably help you to understand the problem better: "The first 4 > bytes contain an integer (in this case, 1,000,000) and then 1,000,000 floats > of 8 bytes each". > > Thank you in advance!