Read date from .CSV in native format of yy-mm-dd
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I am importing data from a .CSV where the native date format is yy-mm-dd. Using functions such as readcell or readmatrix return NaN or Matlab ends up looping because it is having issues with the date format. How can I import this? The formatting of the date is not important, I would just like to have some sort of date stamp for organizational purposes.
Many thanks in advance,
Thomas
0 Kommentare
Antworten (1)
Stephen23
am 19 Jul. 2022
As far as I can tell, it is not possible to specify the pivot year when calling READTABLE et al. But you can do it afterwards:
T = readtable('test.csv','Format','%s%f')
T.timestamp = datetime(T.timestamp,'inputFormat','yy-MM-dd','PivotYear',2000)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Text Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!