Reading data from a website
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, Ia m trying to read some data from the follwing website, I tried to use webread to acheive this but it would give me an array of charcters with size 1x1534400 char where we would like our data to be read into a table. I used the following lines
url="https://lgdc.uml.edu/common/DIDBGetValues?ursiCode=JI91J&charName=foF2,foF1,foE,foEs,hmF2,hmF1,hmE&DMUF=3000&fromDate=1997%2F01%2F01+00%3A00%3A00&toDate=1997%2F12%2F31+11%3A59%3A00";
%options = weboptions("ContentType", "text");
data = webread(url);
the website looks like the image belwo and we would like to ignore the first text lines and start reading from the heading of the table
if anyone can help with this, thanks in advance
댓글 수: 0
답변 (1개)
Walter Roberson
2022년 10월 19일
After you read the characters you can pass them to textscan as the first parameter. You should see either pass Headerlines or CommentStyle to skip the header. Use a %{}T format to describe the datetime and %s for the text fields.
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!