Read_stan_csv error

Hi,

I am running cmdstan 2.21 on Linux then scp to Windows and try to use read_stan_csv. Pretty often (but not always) I receive the message below. Any advice how to get around? Maybe scp needs some parameter?

Error in row.buffer[buffer.pointer, ] <- scan(con, nlines = 1, sep = “,”, :
number of items to replace is not a multiple of replacement length
In addition: Warning message:
In scan(con, nlines = 1, sep = “,”, quiet = TRUE) :
embedded nul(s) found in input

Perhaps something to do with line endings?

What happens if you remove all null instances?
tr < file-with-nulls -d '\000' > file-without-nulls

First, I apologize. Widows has nothing to do. I scp the original csv file from the Linux server to the Linux PC. It is rather huge and with vi on the Linux server I don’t see elapsed time line. After I did

tr <1.csv -d '\000' > 1n.csv

the file went from 92557669 to 74799496. I still don’t see elapsed time. On the server, when I read.csv(“1.csv”), I get

embedded nul(s) found in input

However, read.csv(“1n.csv”) returns no errors. So it looks like there were nuls in cmdstan generated file. readLines gives

incomplete final line found

so it seems cmdstan didn’t finish saving the file. Any ideas how to get around this?

PS. another possibility that I am close to quota and then funny thinks start happening. I will free up space and will try again.

Sorry for the trouble. It was quota problem. Perhaps it would be easy for cmdstan to output a message that line is not written. Just a suggestion.