Sorting cell array by date
    10 views (last 30 days)
  
       Show older comments
    
Hi everybody,
i have cell array, which includes a specific column with dates (dd.mm.yyyy_HH:mm:ss). I want to sort the whole array by this dates. Can anybody help me out?
Matlab R2016a

2 Comments
  the cyclist
      
      
 on 29 Jul 2017
				It would make it easier for us if you uploaded a small sample of your data in a MAT file.
Accepted Answer
  Star Strider
      
      
 on 29 Jul 2017
        
      Edited: Jan
      
      
 on 9 Aug 2017
  
      Your data are already sorted:
D = load('sort-by-2nd-column.mat');
Data = D.GivenData;
[dn,idx] = sort(datenum(Data(2:end,2), 'dd.mm.yyyy_hh:MM:ss'), 1, 'ascend');
There is nothing to do.
% First Row Are Column Labels
Data = D.GivenData(2:end,:);
% First Output Of ‘sort’ Not Necessary, So Not Returned
[~,idx] = sort(datenum(Data(:,2), 'dd.mm.yyyy_hh:MM:ss'), 1, 'ascend');
Data_Sorted = Data(idx,:);
6 Comments
  Peter Perkins
    
 on 1 Aug 2017
				Jan, perhaps I am misunderstanding your statement.
I'm not so sure there's anything efficient about storing those data in a cell array. Every one of those integers in "Auftrag"is stored as a separate MATLAB array, and therefore take up way more memory than they need to. Consider this:
>> x = GivenData(2:end,3);
>> y = [x{:}]';
>> whos x y
  Name       Size            Bytes  Class     Attributes
    x         18x1              2160  cell                
    y         18x1               144  double
That's not going to scale well. And even if memory is not an issue, there's no way to do any kind of math, or even a simple sort, on them. These data are what tables are made for. I'm guessing the cell array came into MATLAB via xlsread. Cut out the middleman and use readtable.
Also, it looks like most or all of the non-numeric data in that cell array could be converted to either datetimes or to categoricals once in the table.
  Jan
      
      
 on 1 Aug 2017
				@Peter Perkins: The original question starts with "i have cell array" and the sorting of the cell array as shown by Star Strider is a direct solution.
Working with tables directly by using readtable is a good idea also, when you have a modern Matlab version and rest of the code does not require the data to be a cell.
More Answers (1)
  John BG
      
 on 7 Aug 2017
        
      Edited: John BG
      
 on 8 Aug 2017
  
      Hi again HaDu
Solved it:
1.
data format conflict: to have sortrows actually ordering dates, the data containing the time data, has to be class datetime. Your cell does not contain time data in such MATLAB class format. Translating:
A = load('sort-by-2nd-column.mat');
B=A.GivenData
    L=B([2:end],1)
    for k=1:1:length(L)
      L{k}(1,[3 6])='-';L{k}(1,11)=' ';
    end
    B([2:end],1)=L
    L=B([2:end],2)
    for k=1:1:length(L)
      L{k}(1,[3 6])='-';L{k}(1,11)=' ';
    end
    B([2:end],2)=L
ZeitString1=B([2:end],1)
ZeitString2=B([2:end],2)
t1=datetime(ZeitString1,'InputFormat','dd-MM-yyyy HH:mm:ss')
t2=datetime(ZeitString2,'InputFormat','dd-MM-yyyy HH:mm:ss')
2.
translating to table requires the name of the rows to meet MATLAB variables rules:
varNames2=B(1,:)
varNames2{8}='Teil_Bez'
varNames2{10}='Rezeptur_Bez'
3.
building the table this way
T3=table(t1,t2,B([2:end],3),B([2:end],4),B([2:end],5),B([2:end],6),B([2:end],7),B([2:end],8),B([2:end],9),B([2:end],10),'VariableNames',varNames2)
now it works:
sortrows(T3,'Auftragsbeginn','ascend')
ans =
  18×10 table
       Auftragsbeginn           Auftragsende        Auftrag    Kavitaet      Werkzeug                                       WerkzeugMINUSBez                                          Teil                               Teil_Bez                           Rezeptur                                                    Rezeptur_Bez                                                 
    ____________________    ____________________    _______    ________    ____________    ___________________________________________________________________________________    ____________    ______________________________________________________    ________    _____________________________________________________________________________________________________________
    06-Dec-2016 00:25:56    05-Jan-2017 07:51:53    [65107]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    05-Jan-2017 07:51:53    18-Jan-2017 07:12:46    [65012]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/36_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    18-Jan-2017 07:12:46    23-Jan-2017 09:34:20    [65717]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.'                        ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0013e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    09-Mar-2017 22:50:43    16-Mar-2017 19:04:09    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    09-Mar-2017 22:50:43    17-Mar-2017 00:59:33    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    17-Mar-2017 00:59:33    21-Mar-2017 08:03:13    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    21-Mar-2017 08:03:13    21-Mar-2017 17:58:55    [66520]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1_nur_aus_PP_anthrazit_Compound_mit_30%_Glasfaser'                                                 
    21-Mar-2017 17:58:55    03-Apr-2017 06:55:23    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    03-Apr-2017 06:55:23    20-Apr-2017 12:58:12    [65595]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._Monosuis'     ''          'Rezeptur_1._PA6_GF_30_Akromid_B3'                                                                           
    20-Apr-2017 12:58:12    02-May-2017 11:33:19    [66816]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    02-May-2017 11:33:19    09-May-2017 06:48:54    [66729]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._monosuis'     ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    09-May-2017 06:48:54    22-May-2017 04:28:52    [67090]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
>> sortrows(T3,'Auftragsbeginn','descend')
ans =
  18×10 table
       Auftragsbeginn           Auftragsende        Auftrag    Kavitaet      Werkzeug                                       WerkzeugMINUSBez                                          Teil                               Teil_Bez                           Rezeptur                                                    Rezeptur_Bez                                                 
    ____________________    ____________________    _______    ________    ____________    ___________________________________________________________________________________    ____________    ______________________________________________________    ________    _____________________________________________________________________________________________________________
    09-May-2017 06:48:54    22-May-2017 04:28:52    [67090]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    02-May-2017 11:33:19    09-May-2017 06:48:54    [66729]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._monosuis'     ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Apr-2017 12:58:12    02-May-2017 11:33:19    [66816]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    03-Apr-2017 06:55:23    20-Apr-2017 12:58:12    [65595]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._Monosuis'     ''          'Rezeptur_1._PA6_GF_30_Akromid_B3'                                                                           
    21-Mar-2017 17:58:55    03-Apr-2017 06:55:23    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    21-Mar-2017 08:03:13    21-Mar-2017 17:58:55    [66520]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1_nur_aus_PP_anthrazit_Compound_mit_30%_Glasfaser'                                                 
    17-Mar-2017 00:59:33    21-Mar-2017 08:03:13    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    09-Mar-2017 22:50:43    16-Mar-2017 19:04:09    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    09-Mar-2017 22:50:43    17-Mar-2017 00:59:33    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0013e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.'                        ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    18-Jan-2017 07:12:46    23-Jan-2017 09:34:20    [65717]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    05-Jan-2017 07:51:53    18-Jan-2017 07:12:46    [65012]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/36_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    06-Dec-2016 00:25:56    05-Jan-2017 07:51:53    [65107]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
>> sortrows(T3,'Auftragsende','ascend')
ans =
  18×10 table
       Auftragsbeginn           Auftragsende        Auftrag    Kavitaet      Werkzeug                                       WerkzeugMINUSBez                                          Teil                               Teil_Bez                           Rezeptur                                                    Rezeptur_Bez                                                 
    ____________________    ____________________    _______    ________    ____________    ___________________________________________________________________________________    ____________    ______________________________________________________    ________    _____________________________________________________________________________________________________________
    06-Dec-2016 00:25:56    05-Jan-2017 07:51:53    [65107]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    05-Jan-2017 07:51:53    18-Jan-2017 07:12:46    [65012]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/36_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    18-Jan-2017 07:12:46    23-Jan-2017 09:34:20    [65717]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.'                        ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0013e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    09-Mar-2017 22:50:43    16-Mar-2017 19:04:09    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    09-Mar-2017 22:50:43    17-Mar-2017 00:59:33    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    17-Mar-2017 00:59:33    21-Mar-2017 08:03:13    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    21-Mar-2017 08:03:13    21-Mar-2017 17:58:55    [66520]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1_nur_aus_PP_anthrazit_Compound_mit_30%_Glasfaser'                                                 
    21-Mar-2017 17:58:55    03-Apr-2017 06:55:23    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    03-Apr-2017 06:55:23    20-Apr-2017 12:58:12    [65595]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._Monosuis'     ''          'Rezeptur_1._PA6_GF_30_Akromid_B3'                                                                           
    20-Apr-2017 12:58:12    02-May-2017 11:33:19    [66816]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    02-May-2017 11:33:19    09-May-2017 06:48:54    [66729]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._monosuis'     ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    09-May-2017 06:48:54    22-May-2017 04:28:52    [67090]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
>> sortrows(T3,'Auftragsende','descend')
ans =
  18×10 table
       Auftragsbeginn           Auftragsende        Auftrag    Kavitaet      Werkzeug                                       WerkzeugMINUSBez                                          Teil                               Teil_Bez                           Rezeptur                                                    Rezeptur_Bez                                                 
    ____________________    ____________________    _______    ________    ____________    ___________________________________________________________________________________    ____________    ______________________________________________________    ________    _____________________________________________________________________________________________________________
    09-May-2017 06:48:54    22-May-2017 04:28:52    [67090]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    02-May-2017 11:33:19    09-May-2017 06:48:54    [66729]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._monosuis'     ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Apr-2017 12:58:12    02-May-2017 11:33:19    [66816]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    03-Apr-2017 06:55:23    20-Apr-2017 12:58:12    [65595]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA_6_GV_anthr._._Mk._Monosuis'     ''          'Rezeptur_1._PA6_GF_30_Akromid_B3'                                                                           
    21-Mar-2017 17:58:55    03-Apr-2017 06:55:23    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    21-Mar-2017 08:03:13    21-Mar-2017 17:58:55    [66520]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1_nur_aus_PP_anthrazit_Compound_mit_30%_Glasfaser'                                                 
    17-Mar-2017 00:59:33    21-Mar-2017 08:03:13    [66217]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    09-Mar-2017 22:50:43    17-Mar-2017 00:59:33    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    09-Mar-2017 22:50:43    16-Mar-2017 19:04:09    [65900]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/22_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Feb-2017 15:29:29    09-Mar-2017 22:50:43    [66337]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._Fk._PA-Traeger'                                              
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0013e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    20-Feb-2017 08:37:19    20-Feb-2017 15:29:29    [66216]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_MK_200MINUSR'                                                  [1.0000e+09]    'Spulenkoerper_MK_200-R_PA_6_GV_anthr.'                   ''          'Rezeptur_2._PA_6_anthrazit_mit_30%_Glasfasern'                                                              
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.'                        ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    23-Jan-2017 09:34:20    20-Feb-2017 08:37:19    [65976]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_6._PA_6_anthrazit_mit_30%_Glasfasern._53_%_Industriequalitaet_Weromid._42_%_Regranulat_Isonyl._5_%'
    18-Jan-2017 07:12:46    23-Jan-2017 09:34:20    [65717]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
    05-Jan-2017 07:51:53    18-Jan-2017 07:12:46    [65012]    [1]         [4.0013e+09]    'WkzgSpulenkoerper_EPA_250_B'                                                          [1.0000e+09]    'Spulenkoerper_EPA_250/36_E_PA_6_natur_GV30'              ''          'Rezeptur_1._nur_aus_PA_6_natur_mit_30%_Glasfasern'                                                          
    06-Dec-2016 00:25:56    05-Jan-2017 07:51:53    [65107]    [1]         [4.0012e+09]    'WkzgMINUSSpulenkoerper_K_250_R_Stamm_Hierfuer_wird_der_Deckel_K_200_R_A_verwendet'    [1.0000e+09]    'Spulenkoerper_K_250_R_PA6_anthr.._GV30_MK._PerlonNex'    ''          'Rezeptur_1._PA_6_anthrazit_mit_30%_Glasfasern._47.5_%_Industriequalitaet_Weromid._47.5_%_Regranulat_Isonyl.'
.
I have appended this correction to the previous answer.
if you find this answer useful would you please be so kind to consider marking this answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG
.
comment:
there's the command array2timetable, that can also be used, but I only had it building a time table with a single time column
varNames=B(1,[3:end])
varNames{6}='Teil_Bez'
varNames{8}='Rezeptur_Bez'
B3=B([2:end],[3:end])
T2=array2timetable(B3,'RowTimes',t1,'VariableNames',varNames)
.
1 Comment
  Jan
      
      
 on 8 Aug 2017
				
      Edited: Jan
      
      
 on 9 Aug 2017
  
			datetime can convert the strings directly without the need to manipulate the strings with some loops before:
B  = A.GivenData(2:end, :);
t1 = datetime(B(:,2), 'Format', 'dd.MM.yyyy_HH:mm:ss');
If there is a good reason to modify the strings, this is easier and faster:
B = A.GivenData(2:end, 1:2);
L = strrep(strrep(B, '.', '-'), '_', ' ');
See Also
Categories
				Find more on Data Type Identification 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!



