Difference between revisions of "Cpsfile"

From Pnb
Jump to navigation Jump to search
(Created page with "back to C-OPS/CERBERUS Mfiles")
 
 
Line 1: Line 1:
 +
<pre>
 +
function cpsfile(letters)
 +
%function to create lisst_prr.txt for prr processing
 +
%looks in lcd directory and checks(for now) "anan...lcd"
 +
 +
d = fullfile(pwd,'*.lcd');
 +
%d2 = fullfile(pwd,'*.lcd.1');
 +
r = dir(d);
 +
%r2 = dir(d2);
 +
s =1;
 +
anname =('');
 +
for i = 1:size(r)
 +
name = r(i).name;
 +
t = strncmp(name,letters,length(letters)); %was "anan"
 +
if t ==1
 +
    name = strtrim(name);
 +
anname(s,:) = name;
 +
s = s+1;
 +
end
 +
end
 +
 +
if isempty(anname) ==1
 +
    d2 = fullfile(pwd,strcat(letters,'*')); %removed .lcd.1 too unique
 +
    r2 = dir(d2);
 +
for i = 1:size(r2)
 +
name2 = r2(i).name;
 +
t = strncmp(name2,letters,length(letters)); %was "anan"
 +
if t ==1
 +
    name2 = strtrim(name2);
 +
    anname(s,:) = name2;
 +
s = s+1;
 +
end
 +
end
 +
end
 +
 +
dlmwrite(strcat(letters(1:3),'list_prr.txt'),anname,'')
 +
 +
 +
</pre>
 +
 +
 
back to [[C-OPS/CERBERUS Mfiles]]
 
back to [[C-OPS/CERBERUS Mfiles]]

Latest revision as of 16:41, 13 February 2014

function cpsfile(letters)
%function to create lisst_prr.txt for prr processing
%looks in lcd directory and checks(for now) "anan...lcd"

d = fullfile(pwd,'*.lcd');
%d2 = fullfile(pwd,'*.lcd.1');
r = dir(d);
%r2 = dir(d2);
s =1;
anname =('');
 for i = 1:size(r)
name = r(i).name;
t = strncmp(name,letters,length(letters)); %was "anan"
if t ==1
    name = strtrim(name);
anname(s,:) = name;
s = s+1;
end
 end

 if isempty(anname) ==1
     d2 = fullfile(pwd,strcat(letters,'*')); %removed .lcd.1 too unique
     r2 = dir(d2);
 for i = 1:size(r2)
name2 = r2(i).name;
t = strncmp(name2,letters,length(letters)); %was "anan"
if t ==1
    name2 = strtrim(name2);
    anname(s,:) = name2;
s = s+1;
end
 end
 end

 dlmwrite(strcat(letters(1:3),'list_prr.txt'),anname,'')



back to C-OPS/CERBERUS Mfiles