How to read date and time of a file?
    6 views (last 30 days)
  
       Show older comments
    
Hi! I'm working to plot the displacement time series of a point but I need the time info of each file. The date and time is on the title of each file, like for example "2016.07.08-00.01.08-StaL-001910-Imera_1". The first numbers indicate the date and time when the data was taken. How can I read the date and time as vectors from the file name?
Thanks!
0 Comments
Accepted Answer
  Jan
      
      
 on 5 Jul 2017
        How are the names available? Do you have them in a cell string already or do you want to grap them by dir?
If you have the string
C = '2016.07.08-00.01.08-StaL-001910-Imera_1'
D = sscanf(C, '%d.%d.%d-%d.%d.%d', 6)
2 Comments
  Jan
      
      
 on 5 Jul 2017
				Perhaps:
Date = D(1:3);
Time = D(4:5);
What does "date in one column" exactly means? What is "a structure of the data"? Please post a small example.
More Answers (1)
See Also
Categories
				Find more on Calendar in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
