Ask a Question related to ASP, Design and Development.

  1. #1

    Default Re: Weather Script Help

    Is this what the data always looks like? Like is it always full and space
    delimited? If it were me, personally, I'd do:

    metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
    TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"

    aWeatherInfo = Split(metar, " ")

    ''don't know what KPGD, are supposed to be
    And you will then have an array of your weather info, like CLR is "clear" I
    suppose, so whether the day is clear, cloudy, etc., that info will always be
    aWeatherInfo(5), assuming that your original weather strings for formatted
    the same.

    Perhaps this uses field lengths to specify the fields though instead, and
    you may have strings like:
    KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2 TSE1757B12E27RAE1754
    SLP167 T02890239 TSNO
    KTR 093409 OFF 000DDF 3 CLD 0/100

    And you'll have to split by position, but I doubt that's how your strings
    come, since there would be issues if the temps reach 100, although it looks
    like you're probably using Celcius.

    Ray at home


    --
    Will trade ASP help for SQL Server help


    "Dave Navarro" <dave@dave.dave> wrote in message
    news:MPG.1999d3413ed09341989743@news-east.giganews.com...
    > I need help with a weather script I converted from Perl to ASP:
    >
    > Function RegEx(ByVal sData, ByVal expr)
    > Dim objRegExpr
    > Set objRegExpr = New regexp
    > objRegExpr.Pattern = expr
    > objRegExpr.Global = True
    > objRegExpr.IgnoreCase = True
    > Dim colMatches
    > Set colMatches = objRegExpr.Execute(sData)
    > If colMatches.Count Then
    > RegEx = colMatches(0).Value
    > End If
    > set colMatches = Nothing
    > set objRegExpr = Nothing
    > End Function
    >
    > metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
    > TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
    >
    > clouds = RegEx(metar, "\b(CLR|SKC|NSC|FEW|SCT|BKN|OVC)\d{3}?\b")
    >
    > This keeps returning an empty string "" instead of "CLR".
    >
    > Can anyone help?
    >
    > --Dave

    Ray at Guest

  2. Similar Questions and Discussions

    1. weather web service
      hi there, I was wondering how I can invoke some certain information about a certain city ( Mexico City ) using a WebService, I was trying with this...
    2. Weather temperature indicator, KDE
      Does anyone know of a program for KDE that will just show the outside temperature down near the clock? Something similar to the Windows version of...
    3. weather web services site?
      I'm working on a project to get weather info for my company and would like to know if there's any good weather web services site I can subscribe to?...
    4. Not sure weather to go ai to pdf or elsewhere
      I created a business card in illustrator cs to get the initial "vector" quality, but... My printshop does not want it in illustrator. instead, either...
    5. Web Service to get the weather forecast
      anybody Knows where can I find Web Service to get the weather forecast for all Worldwide Countries thanks in advance --
  3. #2

    Default Re: Weather Script Help

    It looks like,
    kpgd = location - Punta Gorda, Charlotte County Airport, FL, United States
    the rest of the info can be found at
    [url]http://weather.noaa.gov/weather/current/KPGD.html[/url]


    I suspect you right, they are space separated so a split to array would be
    the smart thing to do.

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:%23IgZl74WDHA.2056@TK2MSFTNGP11.phx.gbl...
    > Is this what the data always looks like? Like is it always full and space
    > delimited? If it were me, personally, I'd do:
    >
    > metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
    > TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
    >
    > aWeatherInfo = Split(metar, " ")
    >
    > ''don't know what KPGD, are supposed to be
    > And you will then have an array of your weather info, like CLR is "clear"
    I
    > suppose, so whether the day is clear, cloudy, etc., that info will always
    be
    > aWeatherInfo(5), assuming that your original weather strings for formatted
    > the same.
    >
    > Perhaps this uses field lengths to specify the fields though instead, and
    > you may have strings like:
    > KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
    TSE1757B12E27RAE1754
    > SLP167 T02890239 TSNO
    > KTR 093409 OFF 000DDF 3 CLD 0/100
    >
    > And you'll have to split by position, but I doubt that's how your strings
    > come, since there would be issues if the temps reach 100, although it
    looks
    > like you're probably using Celcius.
    >
    > Ray at home
    >
    >
    > --
    > Will trade ASP help for SQL Server help
    >
    >
    > "Dave Navarro" <dave@dave.dave> wrote in message
    > news:MPG.1999d3413ed09341989743@news-east.giganews.com...
    > > I need help with a weather script I converted from Perl to ASP:
    > >
    > > Function RegEx(ByVal sData, ByVal expr)
    > > Dim objRegExpr
    > > Set objRegExpr = New regexp
    > > objRegExpr.Pattern = expr
    > > objRegExpr.Global = True
    > > objRegExpr.IgnoreCase = True
    > > Dim colMatches
    > > Set colMatches = objRegExpr.Execute(sData)
    > > If colMatches.Count Then
    > > RegEx = colMatches(0).Value
    > > End If
    > > set colMatches = Nothing
    > > set objRegExpr = Nothing
    > > End Function
    > >
    > > metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
    > > TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
    > >
    > > clouds = RegEx(metar, "\b(CLR|SKC|NSC|FEW|SCT|BKN|OVC)\d{3}?\b")
    > >
    > > This keeps returning an empty string "" instead of "CLR".
    > >
    > > Can anyone help?
    > >
    > > --Dave
    >
    >

    Tom B Guest

  4. #3

    Default Re: Weather Script Help

    The string is "METAR" encoded weather data.

    I could split the values into an array, but then my code converted from
    Perl for decoding would not work. The rest of the code for determining
    temperature, wind speed, wind direction, etc. is all working but that
    one regular expression appears to not work.

    --Dave

    In article <#IgZl74WDHA.2056@TK2MSFTNGP11.phx.gbl>, "Ray at <%
    =sLocation%>" <myfirstname at lane34 dot com> says...
    > Is this what the data always looks like? Like is it always full and space
    > delimited? If it were me, personally, I'd do:
    >
    > metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
    > TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
    >
    > aWeatherInfo = Split(metar, " ")
    >
    > ''don't know what KPGD, are supposed to be
    > And you will then have an array of your weather info, like CLR is "clear" I
    > suppose, so whether the day is clear, cloudy, etc., that info will always be
    > aWeatherInfo(5), assuming that your original weather strings for formatted
    > the same.
    >
    > Perhaps this uses field lengths to specify the fields though instead, and
    > you may have strings like:
    > KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2 TSE1757B12E27RAE1754
    > SLP167 T02890239 TSNO
    > KTR 093409 OFF 000DDF 3 CLD 0/100
    >
    > And you'll have to split by position, but I doubt that's how your strings
    > come, since there would be issues if the temps reach 100, although it looks
    > like you're probably using Celcius.
    >
    > Ray at home
    Dave Navarro Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139