Sorting data based on time
Mostrar comentarios más antiguos
I have multiple csv files and each looks like this.

First column is an ID and the second one is the time (yyyymmddhhmmss). Here date does not change (yymmdd) but the hours changes. Is it possible to create seperate csv (or txt) files with a time limit?
For example, for one ID, could following files be created?
- data raws between 00hr and 03hr
- data raws between 03hr and 06hr
- data raws between 06hr and 09hr etc.
For instance, if there are no data for a given time period, it either creates no csv file or creates an empty csv file.
Again, I'm trying to explore more with this approach. Any suggestion is appreciated!
3 comentarios
Ameer Hamza
el 6 de Mzo. de 2020
Can you provide a sample CSV file? I will help in suggesting a solution.
Jake
el 6 de Mzo. de 2020
Ameer Hamza
el 6 de Mzo. de 2020
Hi James, please check the code in the answer below.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre File Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!