cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

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

jrodriguez-9
8-Gravel

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

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 file 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

 

Thanks

2 REPLIES 2
LucMeekes
23-Emerald III
(To:jrodriguez-9)

The syntax you show does not appear to be Mathcad (nor Prime). Are you using the API?

Why don't you just read the file using the READCSV() function into a matrix. Using Mathcad/Prime matrix operations you can select any rows and/or columns to work with.

 

Success!
Luc

xlsread??

 

Could it be you are confusing "Matlab" with "Mathcad"?

Announcements

Top Tags