I want to ask about how to read a .txt file, for example:
# Contents of table U_WMC.GTS_PERL_SYNOPObtime ID LATITU LONGITU PSTA DIR SPD TEMPE DEW_T RH H_VIS WW CC PRED ENTRY_DATE CL CM CH PTND PTND_CODE WW1 CLOUD_H2010 01 01 00 00 89059 -63.32 -56.68 null 0 0 -.9 -6.8 null 81 null 5 994.1 06-JAN-10 1 1 0 .1 4 null 10002010 01 01 12 00 89059 -63.32 -56.68 null 80 2 -1.7 -7.1 null 82 null 4 993.1 06-JAN-10 4 0 0 .2 4 null 6002010 01 01 15 00 89059 -63.32 -56.68 null 230 6 -1.1 -7.1 null 82 null 5 992.7 06-JAN-10 1 0 0 .4 7 null 15002010 01 01 18 00 89059 -63.32 -56.68 null 260 6 .1 -5.2 null 82 null 2 992.7 06-JAN-10 0 1 0 0 4 null 25002010 01 01 21 00 89059 -63.32 -56.68 null 250 10 1.7 -.5 null 82 null 5 992.6 06-JAN-10 0 1 0 .1 7 null 1000i have try with the coding in my program like this :[yy,mm,dd,Hr,m,ID,LAT,LONG,PSTA,DIR,SPD,TEM,DEW_T,RH,H_VIS,WW,CC,PRED,DD,MM,YY,CL,CM,CH,PTND,PTND_CODE,WW1,CLOUD_H]... = textread('010110.txt','%4d%2d%2d%2d%2d%s%4.4f%4.4f%d%4d%4d%4.4f%4.4f%d%4.4f%d%4d%4.4f%2d-%2d-%2d%d%d%d%f%d%d%4d','delimiter',',','headerlines',2,'whitespace','\n', 'emptyvalue',NaN);
when i run this code, it is not successful read the data. can you tell me whats wrong in my code. i attach my file.
Thank you very much for you answer my question
Best Answer