Sorting data based on time
Show older comments
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 Comments
Ameer Hamza
on 6 Mar 2020
Can you provide a sample CSV file? I will help in suggesting a solution.
Jake
on 6 Mar 2020
Ameer Hamza
on 6 Mar 2020
Hi James, please check the code in the answer below.
Accepted Answer
More Answers (0)
Categories
Find more on File Operations 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!