I have a .csv file and the format is shown below:
mapping.csv
5188.40811,TMobileML
5131.40903,TMobileGregsapt
5119.40791,TMobileJonsapartment
5123.40
Another answer that will work if you have mixed text/numeric csv but you either don't know what the format is, or it's heterogeneous, use the 'csv2cell' function from: http://www.mathworks.com/matlabcentral/fileexchange/20836-csv2cell
c = csv2cell( 'yourFile.csv', 'fromfile');
c(1, :)
will give your headers and c(2:end, k)
will give you each of the columns (sans the header), for k = 1:size(c, 2)
Both csvread and dlmread only work for numeric data. Something like this should work for you
out=textread('tmp.csv', '%s', 'whitespace',',');
nums = out(1:2:end);
strs = out(2:2:end);
% find index of 'TMobileGregsapt'
ind = find(strcmp('TMobileGregsapt',strs));
nums(ind)