Filename truncated in MATLAB

조회 수: 14 (최근 30일)
Deepayan Bhadra
Deepayan Bhadra 2020년 5월 19일
답변: Sumukh 2024년 9월 17일
I am using a command:
[TestDefinitionFiles,testDefinitionFolder] = uigetfile('*.xlsx','Select one or more test definitions that you to execute','MultiSelect','on');
When I load the excel file (Disabled_to_MoveMotor), I see it in TestDefinitionFiles as
Why is the name truncated or is anything wrong from the user's side?
Thanks.

답변 (1개)

Sumukh
Sumukh 2024년 9월 17일
Hi Deepayan,
The truncated filename in the image is in the 8.3 short filename format. This is a format of filename that is used in older file systems that have a limitation on file name length, like FAT16 or FAT32.
  • One possible reason for the truncation is that MATLAB may retrieve the short name of the Excel file if the file is located on a drive that uses such a file system. You can investigate in the Microsoft community to check whether upgrading to a newer file system like NTFS is possible, where this restriction is absent.
  • Another possible reason for the truncation is if the “NTFSDisable8dot3NameCreation” setting is enabled on Windows. You can run the following command on the MATLAB command window to check if the setting is enabled or disabled:
! fsutil behavior query disable8dot3
If the registry value is 0, it means that the 8.3 name creation is enabled. You can disable this setting by referring to the following link from Microsoft:
I am unable to reproduce the truncation issue in MATLAB R2018b, as the file system I am using is NTFS for Windows.
  • A possible workaround to get the file name is to manually type in the excel file name.
  • An alternative workaround to the “uigetfile” command is the “dir” command. This command can be used to get the names of the .XLSX files in the current working directory using the wildcard “*.xlsx”. You can run the following command in the MATLAB command window to know more about the “dir” command:
web(fullfile(docroot, 'matlab/ref/dir.html'))
I hope this helps resolve your issue.

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by