フィルターのクリア

How to read CSV files one at every time using uigetfile and apply a set of formulae

4 ビュー (過去 30 日間)
juan sanchez
juan sanchez 2018 年 9 月 17 日
編集済み: juan sanchez 2018 年 9 月 17 日
Hi, I have several CSV files that contain 10,000 rows by 16 columns in a .CSV generated file as seen in the attachment. I want to execute some formulae on these data so that I can open it up and be able to run the formulae for each CSV file. How can I make this file to work?
Originally I had to convert CSV files to xlsx and then read it as follows.
[num21 txt21 numtxt21] = xlsread('R21_08S','B2:Q10001');
However this is too tedious and I would rather read it as:
[fNameDatai,pathNameData]=uigetfile('*.csv', 'Select the DATA file','Multiselect','on');
if ~iscell(fNameDatai),fNameData{1}=fNameDatai;else fNameData=fNameDatai;end
so that I don't have to convert CSV file to xslx and be able to just select the rows and columns I need.
Thanks

回答 (1 件)

Image Analyst
Image Analyst 2018 年 9 月 17 日
To process a sequence of files, use one of the two code samples in the FAQ:
Just alter it so that the filenames are what you get from uigetfile() instead of dir().
You can use csvread() instead of using xlsread().
  1 件のコメント
juan sanchez
juan sanchez 2018 年 9 月 17 日
編集済み: juan sanchez 2018 年 9 月 17 日
Thank you very much. Would you kindly show me how to do it? I am trying but I do not know how to be able to open R6.csv and apply the set of equations. After if I decide to open R7 and I would like that too but at different times. I only want to select 'R21_08S','B2:Q10001' for each CSV at a time and autogenerate the formula.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by