19 Comments

  1. Cecil

    This is truly awesome, the original csvimport function i used took 2 hours to load a single csv and this is like 10 seconds

    • Lin

      Hi Cecil,

      May I ask how to use the csv reader? I am an absolute beginner for matlab and I would like to import a 1.3G .csv file data in matlab. All the data in the file is one header line and the other are five columns of eight decimal numbers.

      Thanks

  2. George

    This is light years faster than anything that I have used. Do you have a version that reads a certain range in the csv file ? In the original csvread in MATLAB you can specify a range from which to read from (row and column to row and column). The tool is already hugely useful but this addition will make it immensely hugely useful :)

    Thanks for this, it’s great !

  3. Andreas

    Thanks a lot. Tried in vain to get textscan to read a file with datestrings,'”‘-escaped data and some missing values, this solved all problems + it is quick. Good work!

  4. Zoey

    There is an error in the cpp file; the escape character is not in the if-else chain of characters that may be escaped, preventing literal escape characters from being included in fields. I recommend inserting:
    } else if (buf[i] == escape) {
    cell += escape;
    below line 111.

    Otherwise, this library worked charmingly.

  5. vivek

    Hi,
    I was wondering if you have a 32bit compiled MEX.I have a problem with my version of Matlab I use and a free C++ compiler to compile mex.Any help would be greatly appreciated.
    Many Thanks
    vivek

  6. Valjean

    I got an Out of memory error on importing a 1.9Gb csv file, so I’m not too impressed with this program. I’ll keep searching for an alternative method.

    • DV

      For me the program didn’t work because of “Encountered unknown escape sequence”. Tried to fix it but no solution yet..

  7. ksc

    Here, I have seen many discussions with respect to .CSV to .MAT file converter, but still I am little bit confused on this. Can any one help me to write a Matlab code which converts .csv file to .mat file dynamically.

    Here is the first 4 lines of csv file. Sorry I am not allowed to post an csv file here, or I would have.

    [Name] M1 Speed M1 Shaft Torque M2 Speed M2 Shaft Torque [Unit] min-1 N.m min-1 N.m 1 0 0.16805 0 -0.01404 2 0 0.16301 0 -0.01042

    FYI: this is just a sample, My CSV file has 40 columns and 48076 rows. First 2 rows and 2 columns has alphabets, then down remaining all rows n columns has only numbers.

    thanks – ksc

  8. tiaotiao2

    I have tried this function. It is awesome. However, it can only load the first 1048575 rows of the files… Is it possible to load all data from the file.
    By the way, what is the meaning of ‘quote’, ‘sep’, and ‘escape’. Since there is no introduction of these variable, it is hard to apply it in different cases.

    Thanks a lot!

    Ashely

  9. Chaitanya

    Hello,
    I have an excel sheet which has 400000 rows and 22 columns. I have used xlsread to read file, but its taking lots of time. Please help to read it faster.

  10. Naveen

    Wow, how can this be faster than matlab’s CSV reader? You are just reading the file in chunks. Can matlab’s reader be that bad!?!

  11. Al

    As others have said, this would be a lot more useful if it just had a little bit of explanation as to how to use it.

  12. Vinsmoke

    IT DOESNT WORK WITH COMMA SEPERATED VALUES, what is the meaning is not explained, whoever says it is useful please confront it with me

Leave a Reply

Your email address will not be published. Required fields are marked *