I'm trying to figure out how many rows/records my csv file has, which I have to stream because it's quite large.
Can someone tell me if my approach works and how I can get it to loop through the whole data. It works for the n rows I put in the code but since I don't know what number of the last row is I can't get it to work. Basically, I don't know how to finish the Do
command properly where I put the ?????.
stream = OpenRead["C:\\Users\\Name\\Documents\\file.csv"];
list = {};
Do[
record = Read[stream, Record];
AppendTo[list, ToExpression @ First @ StringSplit[record, ","]],
{?????}];
entryCount = Length[list]
Read
will returnEndOfFile
if you attempt to read past the end of the stream. $\endgroup$