Filtering ESGF datasets versions in the metalink
clear all,fclose all;close all;clc; nameFile='./hadgem2_es.metalink'; xmlLines=textread(nameFile,'%s','delimiter','\r\n'); endFiles=find(ismember(deblank(xmlLines),{'</file>'}));Nfiles=length(endFiles); startFiles=[];fileProperties=cell(Nfiles,3);contador=1; for i=1:length(xmlLines) sd=strfind(xmlLines{i},'<file name="'); if ~isempty(sd) startFiles=[startFiles;i]; fileName=['./' xmlLines{i}(sd+12:end-2)]; [pathName,fileName,extFile]=fileparts(fileName); [aux1,aux2,vFile]=fileparts(pathName);vFile=vFile(2:end); fileProperties{contador,1}=fileName;fileProperties{contador,2}=vFile;fileProperties{contador,3}=i; contador=contador+1; end end [fileNames,I1,I2]=unique(fileProperties(:,1)); lastFile=cell(length(I1),3); for i=1:length(I1) indFiles=find(I2==i); versiones=strvcat(fileProperties(indFiles,2));versiones=datenum([str2num(versiones(:,2:5)) str2num(versiones(:,6:7)) str2num(versiones(:,8:9)) repmat([0 0 0],length(indFiles),1)]); [a1,a2]=max(versiones);lastFile(i,:)=fileProperties(indFiles(a2),:); end fid=fopen([nameFile '_last_version.metalink'],'w'); for i=1:min(startFiles)-1 fprintf(fid,'%s \r\n',xmlLines{i}); end Nfiles=length(I1); for i=1:Nfiles indFile=find(startFiles==lastFile{i,3}); for j=startFiles(indFile):endFiles(indFile) fprintf(fid,'%s \r\n',xmlLines{j}); end end for i=max(endFiles)+1:length(xmlLines) fprintf(fid,'%s \r\n',xmlLines{i}); end fclose(fid);
Attachments (1)
- hadgem2_es.metalink (2.0 MB) - added by antonio 6 years ago.
Download all attachments as: .zip
Comments
Hello, this is fastidious post I actually loved reading this. https://foammarker.net
Found your blog excessively interesting indeed. I really enjoyed studying it. https://crossfitsite.com/
No wonder why you receive countless of feedbacks https://www.gympros.com/ .
Even if you’ve tried everything you can think of to get traffic and failed to convert it, you CAN with Click Funnels! We have members making millions of dollars in sales without spending one dime on advertising, using our powerful conversion tools like built-in split-testing, order form bumps, countdown timers, and more at http://clickfunnelsreview.net …
Writers per hour will look into your background and compose a statement which will fulfill your dreams. Capstone Paper- often students ask, someone write my project paper, and Our answer is, of course we can. We will write your project in a way that you will get to learn allot from it and will also get the best grade….. https://www.yellowpages.com/newark-nj/mip/writers-per-hour-custom-writing-service-520720565
Hey to everyone, it’s my first visit of the blog site; this blog includes awesome and actually best info for the visitors. http://clickfunnelsreview.net/
So this will make it easier for people to get the savings they need to have and know the sales are going to continue to give them the income at https://www.ritewik.com/…..
Superb way of explaining, and great blog to get wonderful information. http://www.outdoorlivinggear.com/what-is-the-best-propane-smoker/
You fully match our expectation and the selection of our data. https://online-casino-osterreich.at
top retina specialist in pune - Atharva Netralaya is one of best team of eye specialist in pune, we have more than 56 eye specialist under one roof to know more visit us on http://www.atharvanetralaya.com/best-eye-hospital-in-pune/top-retina-specialist-in-pune/
You create sense out of the foremost complex topics. http://www.pmmarketer.com/
I love all details that you give in your articles. <a href="https://migliorcasinoonlinesicuri.it">migliorcasinoonlinesicuri.it</a>
No doubt why you get so many blog comments. Jamtogel Togel Singapura http://www.jamtogel.com/
Hey to everyone, it’s my first visit of the blog site; this blog includes awesome and actually best info for the visitors. <a href="https://sites.google.com/calgaryseocompany.ca/calgary-seo">calgary Internet marketing</a>
Hey to everyone, it’s my first visit of the blog site; this blog includes awesome and actually best info for the visitors. https://sites.google.com/calgaryseocompany.ca/calgary-seo
Waooow!!! Magnificent blogs, this is what I wanted to search. Thanks buddy <a href="https://sites.google.com/calgaryseocompany.ca/calgary-seo">calgary seo</a>
Keep up the best work guys, nice posts are here to get more benefits. http://www.geeknode.co.za/2016/10/press-release-rage-your-glimpse-into-whats-trending-across-the-globe/
I have visited lots of the blogs but this blog is truthfully wonderful. David
Every week-end I used to pay a fast visit this site, because I’d like enjoyment, because this web site conations certainly fussy material. https://ceske-casino-online.cz/
In this state getting support with your exposition is simply what the understudies require. Getting back into a bad situation! These expositions are justified regardless of an expansive area of your evaluation list and get tallied to make your report card. Normally the understudies oversee presenting the expositions, yet get normal evaluations and when the work heaps up they lose that as well.
http://estrelasdepinhel.com
Filter ESGF datasets versions.
gmail sign up help. Spanish dictionary
I recently came across your blog and have been reading along. https://www.theacademicpapers.co.uk/dissertation-proposal-writing-service.php I think it’s a well informatics written post. Its shows the written quality of writer. Welldone friend keep it up..