MATLAB: Reading first column of a .csv file

csvcsvreadtextread

Hi everyone, I'm having some difficulty getting the information I'm looking for extracted. I would like to pull everything from the first column from rows 2 to the end. When I use txtread I extract the entire document, I've tried a few other read functions however they produced errors. Any help would be greatly appreciated, I've attached the .csv file and the script producing the .csv file. Thanks in advanced and hope you all have a great weekend. Zack
fu=['https://raw.githubusercontent.com/datasets/s-and-p-500-companies/master/data/constituents-financials.csv'];
urlwrite(fu,'Symbols.csv')
symbols=textread('symbols.csv','%s');

Best Answer

I would use xlsread:
[~,symbols] = xlsread('Symbols.csv', 'A:A');
This imports a (497x1) cell of the symbols in Column A, plus the column header ‘Symbol’, so you may only want to use the last 496.