My regular procedure when coming to the task on getting dimensions of a csv file as following:
- Get how many rows it has:
I use a while loop to read every lines and count up through each successful read. The cons is that it takes time to read the whole file just to count how many rows it has.
- then get how many columns it has:
I use
String[] temp = lineOfText.split(",");
and then take the size of temp.
Is there any smarter method? Like:
file1 = read.csv;
xDimention = file1.xDimention;
yDimention = file1.yDimention;