Conditional data extraction from csv file
4 views (last 30 days)
Show older comments
I wish to extract the data from the file 'ddata' into separate excel files containing only the variable columns of
v7,v8,v9 & v10 with respect to the varying values of v3,v4,v5 & v6. The values of v3 varies from 1 to 5, v4 varies from 1 to 2,
v5 varies from 1 to 3, and v6 varies from 1 to 8. For example, the condition when v3=1,v4=1,v5=1 & v6=1 will create the first
excel file. Please help.
5 Comments
dpb
on 24 Jul 2022
Edited: dpb
on 24 Jul 2022
I said it was "air code" -- the format string isn't enclosed in brackets to pull it all together into one string...
>> i=1;sprintf(['Data' repmat('_%02d',1,4) '.xlsx'],id1(i),id2(i),id3(i),id4(i))
ans =
'Data_01_01_01_01.xlsx'
>>
The Q? still is, why do you actually have to have files instead of just processing the groups?
Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!