How to read rows until I find blank row in csv file and copy to another cell?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have .csv file with data.after few rows there are blank rows, blank row can be after 2 rows or after 5 rows or maybe after 150 rows it's not fixed. I wanted to copy data until find blank row and create seperate cell to use it further and do same with next rows of data until I find next blank row. Stuck with logic, tried using readmatrix(filename), tried detecting blank row from 'NaN' string Not able to solve this problem..
0 Commenti
Risposte (1)
Walter Roberson
il 19 Set 2020
Modificato: Walter Roberson
il 19 Set 2020
d = readmatrix(filename)
mask = any(isnan(d), 2).';
starts = findstr([false, mask], [0,1]);
stops = findstr([mask, false], [1,0]);
blocks = arrayfun(@(s,e)d(s:e,:), starts, stops, 'uniform', 0);
6 Commenti
Vedere anche
Categorie
Scopri di più su Block Libraries 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!