How to filter my timestamped CSV file?

2 views (last 30 days)
balaji
balaji on 5 May 2015
Edited: balaji on 5 May 2015
Dear friends,
I'm a novice MATLAB user. This is my problem outline. I've several sensor (energy meter) data in the form of both .CSV files & .SQL files.
Note: Every file has several thousand lines of data points each of which are timestamped per second.
For example, this is how my data looks like. (First 2 rows correspond to event#1 & last 2 rows correspond to event#3)
4/14/2015 0:24:10 AM 0 0 27.35630823 642 240.6875674 3177698 0.113659 32474 4/14/2015 0:24:11 AM 0 0 27.26100811 644 237.7914657 3150830 0.1146425 32755 4/14/2015 23:44:51 PM 50.235263 1339 60.27022482 1435 240.6986698 3177801 0.250397 71542 4/14/2015 23:44:51 PM 49.935127 1331 59.32181601 1426 238.5314441 3157695 0.248696 71056 4/14/2015 23:44:52 PM 49.484923 1319 58.69500838 1415 237.1156224 3144560 0.2475375 70725
I wanted to do the following with each file:
1) My data has 8 fields (columns). My first column is date+time and I would like to detect & eliminate the duplicate rows. For example, row 4 above. 2) Then index my table (using timestamp) to filter out data between specific range of time and label them as separate events. For example, data between 4/14/2015 0:24:10 AM & 4/14/2015 0:24:11 AM as Event#1 and that between 4/14/2015 23:44:51 PM & 4/14/2015 23:44:52 PM as Event#2 respectively, and so on.
I have already tried functions such as these..
[num,txt,raw]=xlsread('C:\Users\AdminNUS\Desktop\disaggtotal_sde2_1_1 (1).csv'); agg_realpower=num(:,1); timestamp=datenum(txt); //To filter and remove uniqueIDs= unique(timestamp(:,1));
Can you please help with suitable functions to help me do these functionalities?
Thanks, Balaji

Answers (0)

Categories

Find more on Tables 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!