how to fix this upper directory link?

1 vue (au cours des 30 derniers jours)
Leon
Leon le 15 Fév 2020
Commenté : Leon le 15 Fév 2020
File_W = fullfile(app.Path, '..', 'MyFolder', [fileName, '_myFormat_.xlsx']);
writetable(T1, File_W);
The above is my code to write my Excel file in a upper level directory (parallel with app.Path, in this case: /Voumes/DATA/ABC) named MyFolder. It works well. Here is the probelm. Now when I try to display 'File_W' in my uialert, it shows as the below:
/Volumes/DATA/ABC/../MyFolder
When it should be:
/Volumes/DATA/MyFolder
Is there a way I can fix it?
Thanks.
  1 commentaire
Leon
Leon le 15 Fév 2020
Many thanks.

Connectez-vous pour commenter.

Réponse acceptée

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH le 15 Fév 2020
File_W = fullfile(app.Path, '..', 'MyFolder', [fileName, '_myFormat_.xlsx']);
writetable(T1, File_W);
a=dir(File_W);
namefolder=a(1).folder

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by