Reading huge number of excel files in a loop
1 次查看(过去 30 天)
显示 更早的评论
Hi!
I have 1090 .csv files to read. What I am trying to accomplish is compare column 1 from each of those Excel files and then extract the elements common in that column across all the 1090 .csv files. Since MATLAB does not already have a function to intersect multiple vectors, I am using the MINTERSECT function I found here ( https://www.mathworks.com/matlabcentral/fileexchange/6144-mintersect-multiple-set-intersection ).
The problem I am encountering is that the number of arguments for this function is HUGE in my case! Even if it is a lot, I can definitely mention all the vector names in the argument, that's not difficult. But before doing that I need to read all the 1090 .csv files and extract the column 1 elements and store it in a different vector with a different name corresponding to each .csv file. I was trying to do this using a FOR loop but I am not able to do it.
Can someone please help? Please let me know if you need any more clarification from me.
1 个评论
回答(1 个)
dpb
2018-8-8
All that function is is a loop around intersect one vector at a time; that's all you need must do, there's no need to put all the variables into the argument list at all, just start with the first and rinse and repeat 'til done.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!