- Timestamp:
- Nov 26, 2010, 5:44:41 AM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/name2display.m
r122 r138 74 74 %case of a numerical index follewed by a lower case letter (e.g. a,b,c): 75 75 %the penultimate character is a number and the last one a letter (lower case: last >= 97 && last <= 122 76 % capital letter: last >= 65 && last <= 90) 77 elseif penult >= 48 && penult <= 57 && (last >= 65 && last <= 90)||(last >= 97 && last <= 122) 76 % capital 77 % letter: last >= 65 && last <= 90) 78 elseif penult >= 48 && penult <= 57 && ((last >= 65 && last <= 90)||(last >= 97 && last <= 122)) 78 79 str_a=last_str; %extract appendix a,b,c... or A,B,C... as output. 79 80 ind_end=indcur-1; %current index just before the suffix letter … … 129 130 elseif strcmp(filelit(end),'_') 130 131 indcur=separ3-1; 131 % field_count=num3;132 132 str2=''; 133 133 str_a=''; 134 134 %detect zeros before the number 135 % count=0; % extract the numerical appendix136 135 field_count=RootFile(separ3+1:end);% set the selected field number'%03d' 137 136 charstring=['%0' num2str(length(field_count)) 'd']; 138 137 nom_type=['_' num2str(1,charstring)]; 139 % if strcmp('0',RootFile(separ3+1)); % select the non-numerical characters140 % nom_type=['_%0' num2str(length(RootFile(separ3+1:end))) 'd'];141 % else142 % nom_type='_i';143 % end144 145 138 elseif RootFile(indcur-2)=='_'% search appendix a,b,c,d 146 last=RootFile(indcur-1:indcur); 147 if isequal(length(last),2) 148 str_a=last(1);%put appendix a,b,c, ou d 149 str_b=last(2);%put appendix a,b,c, ou d 150 % indcur=indcur-3; 151 separ0=indsel(end-3); 139 lasts=RootFile(indcur-1:indcur); 140 % if isequal(length(last),2) 141 str_a=lasts(1);%put appendix a,b,c, ou d 142 str_b=lasts(2);%put appendix a,b,c, ou d 143 separ0=indsel(end-3); 152 144 field_count=RootFile(separ0+1:separ1-1); 153 145 indcur=separ0; 154 if double(last ) >= 97 & double(last)<= 122146 if double(lasts) >= 97 & double(lasts)<= 122 155 147 nom_type='_ab'; 156 148 testsub=1; 157 elseif double(last ) >= 65 & double(last) <= 90149 elseif double(lasts) >= 65 & double(lasts) <= 90 158 150 nom_type='_AB'; 159 151 testsub=1; … … 161 153 charstring=['%0' num2str(length(field_count)) 'd']; 162 154 nom_type=[num2str(1,charstring) nom_type]; 163 end155 % end 164 156 %search for other names with counter 165 157 else … … 178 170 charstring=['%0' num2str(length(field_count)) 'd']; 179 171 nom_type=num2str(1,charstring); 180 % if isequal(field_count(1),'0')181 % nbfigures=length(field_count);182 % nom_type=['%0' num2str(nbfigures) 'd'];183 % else184 % nom_type='#';185 % end186 172 end 187 173 end -
trunk/src/name_generator.m
r127 r138 85 85 nom_type_mod=nom_type; 86 86 num_j_str=''; 87 if strcmp(nom_type(1),'_') 88 filename=[filename '_']; 89 nom_type_mod(1)=[]; 90 end 91 if strcmp(nom_type_mod(end),'a') 92 nom_type_mod(end)=[]; 93 num_j_str=char(num_j1+96);% lower letter corresponding to the index 94 elseif strcmp(nom_type_mod(end),'A') 95 nom_type(end)=[]; 96 num_j_str=char(num_j1+64);% lower letter corresponding to the index 97 elseif isequal(numel(regexp(nom_type_mod,'_')),1)%if a second separator '_' exists in nom_type 98 num_j_str=['_' num2str(num_j1)]; 99 nom_type_mod(regexp(nom_type_mod,'_'):end)=[]; 87 if strcmp(nom_type,'1') 88 filename=[filename num2str(num_i1) ext]; 89 elseif length(nom_type)<=1%fixed name , no indexing, for instance '*' 90 filename=[filename ext]; 100 91 else 101 num_j1_out=[];%no index j 102 end 103 if ~isnan(str2double(nom_type_mod)) 104 numtype=['%0' num2str(length(nom_type_mod)) 'd'];%indicate the number of digits (0 before the number) 105 filename=[filename num2str(num_i1,numtype) num_j_str ext]; 106 num_i2_out=num_i1_out; 107 num_j2_out=num_j1_out; 108 else %fixed name , no indexing, for instance '*' 109 % filebasesub=filebase; 110 filename=[filename ext]; 92 nom_type_mod=nom_type; 93 if strcmp(nom_type(1),'_') 94 filename=[filename '_']; 95 nom_type_mod(1)=[]; 96 end 97 if strcmp(nom_type_mod(end),'a') 98 nom_type_mod(end)=[]; 99 num_j_str=char(num_j1+96);% lower letter corresponding to the index 100 elseif strcmp(nom_type_mod(end),'A') 101 nom_type(end)=[]; 102 num_j_str=char(num_j1+64);% lower letter corresponding to the index 103 elseif isequal(numel(regexp(nom_type_mod,'_')),1)%if a second separator '_' exists in nom_type 104 num_j_str=['_' num2str(num_j1)]; 105 nom_type_mod(regexp(nom_type_mod,'_'):end)=[]; 106 else 107 num_j1_out=[];%no index j 108 end 109 if ~isnan(str2double(nom_type_mod)) 110 numtype=['%0' num2str(length(nom_type_mod)) 'd'];%indicate the number of digits (0 before the number) 111 filename=[filename num2str(num_i1,numtype) num_j_str ext]; 112 num_i2_out=num_i1_out; 113 num_j2_out=num_j1_out; 114 else %fixed name 115 filename=[filename ext]; 116 end 111 117 end 112 118
Note: See TracChangeset
for help on using the changeset viewer.