Pulling Columns by Name in CSV Files
Hello! I am having trouble with pulling specific data. I am trying to read a .csv file and grab specific columns by name, not by the column number/position. The data I a looking to grab doesnt’t always end up in the same column.
CurrentData = readtable(‘data.csv’,’ReadVariableNames’,1);
TimeData = CurrentData(:, 1); % Column A data ( time in seconds )
I have time data as a specific column since it is always in the first column. Here is some code I’ve tried from other threads but I now have an issue with the size –
[data, text] = readtable(‘5DV20WLRCJ010__671_edited.csv’);
Throttle = strcmpi(text(1,:),’d ThrottleAct’);
A = data(:,Throttle);
‘d ThrottleAct’ is the column I am trying to pull, but the data too large when I try this method – that and I don’t fully understand it, haha. The data I am using is a 2567×468 table, and sometimes there are more or less variables.
Here is the error I get:
Error using readtable
Too many output arguments.
Error in project_testing (line 22)
[data, text] = readtable(‘data.csv’);
I think it is having trouble with the read table, but I’m not sure of a better way to read the data and column headers as well as keeping it in this format.
Thanks for the help in advanceHello! I am having trouble with pulling specific data. I am trying to read a .csv file and grab specific columns by name, not by the column number/position. The data I a looking to grab doesnt’t always end up in the same column.
CurrentData = readtable(‘data.csv’,’ReadVariableNames’,1);
TimeData = CurrentData(:, 1); % Column A data ( time in seconds )
I have time data as a specific column since it is always in the first column. Here is some code I’ve tried from other threads but I now have an issue with the size –
[data, text] = readtable(‘5DV20WLRCJ010__671_edited.csv’);
Throttle = strcmpi(text(1,:),’d ThrottleAct’);
A = data(:,Throttle);
‘d ThrottleAct’ is the column I am trying to pull, but the data too large when I try this method – that and I don’t fully understand it, haha. The data I am using is a 2567×468 table, and sometimes there are more or less variables.
Here is the error I get:
Error using readtable
Too many output arguments.
Error in project_testing (line 22)
[data, text] = readtable(‘data.csv’);
I think it is having trouble with the read table, but I’m not sure of a better way to read the data and column headers as well as keeping it in this format.
Thanks for the help in advance Hello! I am having trouble with pulling specific data. I am trying to read a .csv file and grab specific columns by name, not by the column number/position. The data I a looking to grab doesnt’t always end up in the same column.
CurrentData = readtable(‘data.csv’,’ReadVariableNames’,1);
TimeData = CurrentData(:, 1); % Column A data ( time in seconds )
I have time data as a specific column since it is always in the first column. Here is some code I’ve tried from other threads but I now have an issue with the size –
[data, text] = readtable(‘5DV20WLRCJ010__671_edited.csv’);
Throttle = strcmpi(text(1,:),’d ThrottleAct’);
A = data(:,Throttle);
‘d ThrottleAct’ is the column I am trying to pull, but the data too large when I try this method – that and I don’t fully understand it, haha. The data I am using is a 2567×468 table, and sometimes there are more or less variables.
Here is the error I get:
Error using readtable
Too many output arguments.
Error in project_testing (line 22)
[data, text] = readtable(‘data.csv’);
I think it is having trouble with the read table, but I’m not sure of a better way to read the data and column headers as well as keeping it in this format.
Thanks for the help in advance matlab, matlab code, importing excel data, excel, column headers, recalling, spreadsheet, data import, data MATLAB Answers — New Questions