finding path and timestamp of file used
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Neesha
el 12 de Dic. de 2014
Comentada: Adam
el 12 de Dic. de 2014
Hi All,
I am reading data into dataset with rawData = dataset('XLSFile','myData.csv', 'sheet','myData');
I want to collect entire file path with timestamp so that i can later print it as report for all input files like this.
How do i do it?
Respuesta aceptada
Image Analyst
el 12 de Dic. de 2014
Try this:
filename = which(mfilename('fullpath')) % Whatever you need.
fileInfo = dir(filename)
fprintf('The date of %s\nis %s\n', filename, fileInfo.date);
In the command window:
filename =
C:\Users\Neesha\Documents\MATLAB\work\Tests\test1.m
fileInfo =
name: 'test1.m'
date: '12-Dec-2014 15:01:02'
bytes: 395
isdir: 0
datenum: 735945.625717593
The date of C:\Users\Neesha\Documents\MATLAB\work\Tests\test1.m
is 12-Dec-2014 15:01:02
there is also the datenum value you can use if you need a number instead of a string.
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!