ExtractBetween: Element 2 of the text contains 1 substrings while the previous elements have 0. All elements must contain the same number of substrings.

14 ビュー (過去 30 日間)
LabRat
LabRat 2022 年 8 月 15 日
編集済み: Stephen23 2022 年 8 月 16 日
Error using extractBetween (line 79)
Element 2 of the text contains 1 substrings while the previous elements have 0. All
elements must contain the same number of substrings.
files_in_folder = dir('directory/*.mp4');
{files_in_folder.name}
id = extractBetween({files_in_folder.name}, 'file_', '_');
%an example file name would be file_123_test.mp4
The output of {files_in_folder.name} holds and extra file named '.mp4' with no title, just the file extentions mp4. I checked the directory but ther is no such file called '.mp4'.
  2 件のコメント
Stephen23
Stephen23 2022 年 8 月 16 日
編集済み: Stephen23 2022 年 8 月 16 日
" checked the directory but ther is no such file called '.mp4'."
How exactly did you "check" the directory? By unreliably looking at something like MS File Explorer, or reliably using a tool that can actually list all files? If using a reliable tool, please show the command you used and its output.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by