MATLAB Answers

Join multiple readtable data with WeirdDuration

2 views (last 30 days)
Jogger on 24 Dec 2019
Edited: Jogger on 28 Jan 2020
I need help in join the readtablefcn with attached files to an exsisting routine so that I can combine multiple table data.
I have file with different format and I join them using below routine. Example


Show 8 older comments
Adam Danz
Adam Danz on 26 Dec 2019
Ok, I can run the code now.
Now I need to understand where the problem is. Is the problem in this line (line number 55 in get_fieldnames)?
joinedtimetable = outerjoin(joinedtimetable, structtimetable,'Merge',true); % 'LeftKeys','RightKeys'
You're merging two table with different column names.
ans =
1×3 timetable
WeirdDuration log_autoserv1_autoserv Sublog_autoserv1_autoserv Message_autoserv1_autoserv
_____________ ______________________ _________________________ ______________________________________________________________________________________________
00:00:00.000 {'INFO |'} {'autoserv:0739|'} {'Results placed in /tmp/test_that_results_hatch_ZByste/results-17-firmware_TPMKernelVersion'}
ans =
1×3 timetable
WeirdDuration DBGLog_upstart1_upstart InnerTime_upstart1_upstart Message_upstart1_upstart
_____________ _______________________ __________________________ _________________________________________________________________
00:00:00.000 {'WARNING kernel:'} {'[ 10.690227]'} {'init: failsafe-delay main process (681) killed by TERM signal'}
Adam Danz
Adam Danz on 2 Jan 2020
Hi again, I just spent about 20+ minutes re-reading the comments and going through the code and I still cannot understand exactly what we're trying to fix. I'd like to help but I it's just taking too much time to sift through all of this in order to understand the problem - even at a big picture level.
This is why is important to reproduce the problem with as little code as possible in order to provide a Minimal Working Example. Ideally, you'll get the fastest responses when the problem is described super clearly in just a few sentences and we can copy a short bit of code into our workspace that demonstrates the problem.

Sign in to comment.

Accepted Answer

Adam Danz
Adam Danz on 7 Jan 2020
In your formatSpec,
formatSpec = '%*6s%13{hhmmss.SSSSSS}D%C%[^\n\r]';
note that you're using lower case hh which is for 12-hour clocks. It works for the update_engine data because the hours are all less than 12:00. But it doesn't work for the powerd data because 17:40:01 is greater than 12:00.
You need to use 24-hour clock notation by using upper case HH.
formatSpec = '%*6s%13{HHmmss.SSSSSS}D%C%[^\n\r]';
% ^^

  1 Comment

Jogger on 8 Jan 2020
Super catch. Problem solved .Thanks a lot

Sign in to comment.

More Answers (1)

Jogger on 8 Jan 2020
Edited: Jogger on 8 Jan 2020
I have raised a new issue. Can you please look in the below link and please help me . Thank you


Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!