How can I Use writecell with a dynamically changing file save name?

Hello all,
I am analyzing hundreds of gigabytes of BLF Data and I am converting the BLF files into CSV files using writecell. The issue I face right now, is that I need to run each file one by one because the CSV file that prints out is a static file name. (In my case I just have it write to "final.csv") But I want the new CSV file name to match the original BLF file name. Currently my script can integrate through a folder with multiple BLF files but that isnt very useful because it only outputs one csv file.
output = [header; num2cell(data)];
writecell(output,baseFileName.csv);
output is my final cell with the required data. I tried using the method above, but you cannot use "dot indexing" with writecell. Pretty much I need a dynamic writecell file name but I have no clue how to get it. Let me know if clarification is needed.

 採用された回答

Jan
Jan 2022 年 3 月 16 日
編集済み: Jan 2022 年 3 月 16 日

0 投票

Maybe you mean:
writecell(output, [baseFileName, '.csv']);
baseFileName.csv would be the field 'csv' of a struct called baseFileName.

1 件のコメント

Maksim Sorin
Maksim Sorin 2022 年 3 月 16 日
Wow this is just what I needed! Thanks Jan!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

製品

リリース

R2020b

質問済み:

2022 年 3 月 16 日

コメント済み:

2022 年 3 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by