X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07 Jul 2014 12:27 PM by  anon
Comparison between arrays with different lenght
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
07 Jul 2014 12:27 PM
    Hello everybody! I'd like to ask you about a simple problem I have with my program. I have 2 .txt files that are like this: FILE 1 (all data, day-by-day) JULIANDAYYEAR MM DD OZONE STD 2448623 1992 1 1 0 2448624 1992 1 2 308.5 0.90 2448624 1992 1 2 306.9 0.80 2448624 1992 1 2 306.6 0.90 2448624 1992 1 2 303.6 0.60 2448624 1992 1 2 300.9 1.40 2448624 1992 1 2 301.3 1.20 2448624 1992 1 2 296.8 1.20 2448624 1992 1 2 298.8 1.10 2448624 1992 1 2 298.5 1.80 2448624 1992 1 2 298.4 0.60 2448624 1992 1 2 299.8 0.50 2448624 1992 1 2 299.9 0.60 2448624 1992 1 2 299.3 0.50 2448625 1992 1 3 304.4 1.20 2448625 1992 1 3 303.2 1.20 ... FILE2 (there are the averages) JULIANDAY DD MM AVERAGE 2448623 1 1 0.00 2448624 2 1 301.20 2448625 3 1 299.08 2448626 4 1 0.00 2448627 5 1 292.77 2448628 6 1 283.17 2448629 7 1 0.00 2448630 8 1 267.60 ... Now I would like to create a new file like this: JULIANDAYYEAR MM DD OZONE STD AVERAGE 2448623 1992 1 1 0 0 2448624 1992 1 2 308.5 0.90 301.2 2448624 1992 1 2 306.9 0.80 301.2 2448624 1992 1 2 306.6 0.90 301.2 2448624 1992 1 2 303.6 0.60 301.2 2448624 1992 1 2 300.9 1.40 301.2 2448624 1992 1 2 301.3 1.20 301.2 2448624 1992 1 2 296.8 1.20 301.2 2448624 1992 1 2 298.8 1.10 301.2 2448624 1992 1 2 298.5 1.80 301.2 2448624 1992 1 2 298.4 0.60 301.2 2448624 1992 1 2 299.8 0.50 301.2 2448624 1992 1 2 299.9 0.60 301.2 2448624 1992 1 2 299.3 0.50 301.2 2448625 1992 1 3 304.4 1.20 299.08 2448625 1992 1 3 303.2 1.20 299.08 but I can't because arrays have a different lenght. How can I do this comparison? For the moment I was only able to open the files: OPENR,5, inputfile3 READF,5, riga OPENW, 10, output4 WHILE NOT EOF(5) DO BEGIN READF,5, giuliano_t1, anno_t1, mese_t1, giorno_t1, ozono_t1, stdozono_t1 giuliano=[giuliano,giuliano_ t1] dd=[dd,giorno_t1] mm=[mm,mese_t1] anno=[anno,anno_t1] to3=[to3,ozono_t1] ENDWHILE OPENR,4, output3 READF,4, riga WHILE NOT EOF(4) DO BEGIN READF,4, giuliano_t2, giorno_t2, mese_t2, mediato_t2 giuliano2=[giuliano2,giuliano_t2] giorno1=[giorno1,giorno_t2] mese1=[mese1,mese_t2] mediato1=[mediato1,mediato_t2] ENDWHILE Thank you for your help, I am a beginner with IDL!
    You are not authorized to post a reply.