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.