how to find a specific value from a textfile(3000 lines), when the value keeps on changing its location in the file
이전 댓글 표시
In my code, I have to download weather data every hour from the website ( http://api.met.no/weatherapi/locationforecast/1.9/?lat=52.37;lon=4.89;msl=1) I am able to do so but now i need to find the value for "cloudiness" for the time period 24 hours after it was downloaded. I just need numerical value of cloudiness. I tried getting that data by importing data from that specific cell, but the value keeps on changing its value location. So I need to update the cell location for every time I run my code.How should I get the exact numerical value.
For example: I want the cloudiness for the date "from="2015-03-12T11:00:00Z" to="2015-03-12T11:00:00Z"
The code goes like this:
<time datatype="forecast" from="2015-03-12T11:00:00Z" to="2015-03-12T11:00:00Z">
<location altitude="1" latitude="53.0500" longitude="4.8000">
<temperature id="TTT" unit="celsius" value="8.3"/>
<windDirection id="dd" deg="138.0" name="SE"/>
<windSpeed id="ff" mps="4.5" beaufort="3" name="Lett bris"/>
<humidity value="62.9" unit="percent"/>
<pressure id="pr" unit="hPa" value="1030.9"/>
*<cloudiness id="NN" percent="0.0"/>*
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="0.0"/>
<mediumClouds id="MEDIUM" percent="0.0"/>
<highClouds id="HIGH" percent="0.0"/>
<dewpointTemperature id="TD" unit="celsius" value="1.6"/>
</location>
</time>
<time datatype="forecast" from="2015-03-12T10:00:00Z" to="2015-03-12T11:00:00Z">
<location altitude="1" latitude="53.0500" longitude="4.8000">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2015-03-12T09:00:00Z" to="2015-03-12T11:00:00Z">
<location altitude="1" latitude="53.0500" longitude="4.8000">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2015-03-12T08:00:00Z" to="2015-03-12T11:00:00Z">
<location altitude="1" latitude="53.0500" longitude="4.8000">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="Sun" number="1"/>
</location>
</time>
<time datatype="forecast" from="2015-03-12T05:00:00Z" to="2015-03-12T11:00:00Z">
<location altitude="1" latitude="53.0500" longitude="4.8000">
<precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0"/>
<symbol id="LightCloud" number="2"/>
</location>
</time>
This is one basic data in the file. Now i want to get numerical data (for cloudiness) in the line 10.
What will be the best way to read the particular data?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!