How to extract the column_13 from 79 csv files and save into the new csv file
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
muhammad choudhry
il 17 Giu 2022
Modificato: Geoff Hayes
il 17 Giu 2022
Hi,
How to extract the column_13 from 79 csv files and save it in a separate csv file so the new csv file will have 79 column of column_13 from each file. I am able to read column_13 from one file but not sure how to extract from all the files and save it in a separate file.
Code Tried so far:
dataFolder = 'F:\3-PIV_Experimental_Data\Calculations_TurbulentIntensity\line_Data\Elliptical_Side_LSB\Length\DesignPoint\110_outlet';
list = dir(fullfile(P,'*.csv'));
for kk = 1:numel(list)
data = readtable(...
fullfile(list(kk).folder, list(kk).name));
extract = (data{:,13});
end
0 Commenti
Risposta accettata
Geoff Hayes
il 17 Giu 2022
@muhammad choudhry - create a cell array to store the 13th column from each file. For example,
extractedData = cell(numel(list),1);
for kk = 1:numel(list)
data = readtable(...
fullfile(list(kk).folder, list(kk).name));
extractedData{kk} = data{:,13};
end
Then you should be able to save the extractedData to your new file.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Import and Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!