1
$\begingroup$

I am working with relatively large CSV files (1.5 MB+) and while testing the code, I have to frequently open up the CSV files to read a particular row, validate the data are there and then close the CSV file and move to another one.

Files which are larger than 1.5 MB are taking about 40 seconds per file open on my computer. Is there any tool that will allow me to open large CSV files quickly (I am only looking to read the CSV file and therefore a CSV reader that opens up files quickly will be useful)

Alternatively, if there is any tool that will perhaps when the first 1000 lines or the last 1000 lines will be good. I know I can do this in UNIX by using commandline utilities but then they dump the data in different files and again I will have to delete those files. Moreover, I'm looking for a solution on Windows.

I hope somebody can help resolve this. Thank you for any inputs!

$\endgroup$
2
$\begingroup$

notepad++ will open a file of that size very quickly.

|improve this answer|||||
$\endgroup$
  • $\begingroup$ Thank you for the comment. I have tried using notepad++. For me the time taken is shorter than Microsoft Excel but still quite long given that I just have to look at a few lines and then move onto another CSV file. $\endgroup$ – Ramana Sep 9 '18 at 4:47
2
$\begingroup$

If you are comfortable with Windows PowerShell, you may use gc command.

To see the first 1000 lines of a file:

gc -head 1000 filename.csv

To see the last 1000 lines of a file:

gc -head 1000 filename.csv

This is similar to the head and tail in UNIX. BTW both in Windows and UNIX those commands do not dump the data into different files and require you to delete.

You may also find the more command useful if you try to browse through a large file.

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.