extracting four words from a file name and placing them in four cells at the start of each row of a data table.

1 回表示 (過去 30 日間)
I am trying to creat a GUI that will process files for me and create an excel sheet. I want to take four words from my filename and place them in four cells at the start of each row of data in the file. Below is the code I am working on :
cd = app.selectedPath;
[A] = my function string ;
Aa = rmfield(A,'field_');
Ab = struct2table(Aa);
filePattern = fullfile(cd,'A_*):
fileList = dir(filePattern);
B = strsplit(fileList.name,'_');
Bb = N([1 11 12 13]);
*** following this is a loop that goes through the file pattern and processes all similar files and saves out an excel sheet with the original file name. Bb are the four cells I want to add to Ab. Ab will always be various lengths.

回答 (1 件)

Navya Singam
Navya Singam 2022 年 11 月 22 日
Hi,
You can refer to the documentation of writeTable to understand on how to write to excel sheet and App Designer to create GUI.
  1 件のコメント
WENDILYN GUIDOTTI
WENDILYN GUIDOTTI 2022 年 11 月 23 日
My excel sheet comes out ok, it is just adding the additional columns to each row that I cannot piece together.

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

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by