stripping texts ".24 to "

Welcome Forums Pester stripping texts ".24 to "

Viewing 2 reply threads
  • Author
    Posts
    • #129330
      Participant
      Topics: 2
      Replies: 2
      Points: 18
      Rank: Member

      code $Location = “C:\weather\weatherdec.txt”

      code$Location1 = “C:\weather\weatherdec1.txt”

      code$Change = Get-Content $Location

      code$Change | Select-Object -Skip 17 | ForEach-Object {$_ -replace “.24” , “”} |Set-Content $Location

      FZPN40 PHFO 112212
      HSFNP 
      
      HIGH SEAS FORECAST
      NATIONAL WEATHER SERVICE HONOLULU HI
      2300 UTC TUE DEC 11 2018
      
      SUPERSEDED BY NEXT ISSUANCE IN 6 HOURS
      
      SEAS GIVEN AS SIGNIFICANT WAVE HEIGHT...WHICH IS THE AVERAGE HEIGHT
      OF THE HIGHEST 1/3 OF THE WAVES. INDIVIDUAL WAVES MAY BE MORE THAN
      TWICE THE SIGNIFICANT WAVE HEIGHT.
      
      THIS HIGH SEAS FORECAST USES 1-MINUTE AVERAGE WINDS WHICH MAY BE
      HIGHER THAN 10-MINUTE AVERAGE WINDS.
      
      SECURITE
      
      NORTH PACIFIC EQUATOR TO 30N BETWEEN 140W AND 160E
      
      SYNOPSIS VALID 1800 UTC DEC 11 2018.
      24 HOUR FORECAST VALID 1800 UTC DEC 12 2018.
      48 HOUR FORECAST VALID 1800 UTC DEC 13 2018.
      
      .WARNINGS.
      
      ...GALE WARNING...
      .NE TO E WINDS 25 TO 35 KT AROUND THE MAIN HAWAIIAN ISLANDS. FOR 
      DETAILS SEE THE LATEST COASTAL WATERS FORECAST ISSUED BY NWS 
      HONOLULU UNDER WMO HEADER FZHW40 PHFO AND AWIPS HEADER CWFHFO. 
      .24 HOUR FORECAST WINDS DIMINISHED BELOW 35 KT AROUND THE MAIN 
      HAWAIIAN ISLANDS.
      
      .SYNOPSIS AND FORECAST.
      
      .LOW 04N171E 1006 MB MOVING NW 10 KT. TROUGH FROM 12N174E TO LOW 
      TO 03N167E TO 02N160E NEARLY STATIONARY. SCATTERED MODERATE TO 
      STRONG TSTMS WITHIN 360 NM OF A LINE FROM 14N179E TO 08N175E TO
      00N172E. 
      .24 HOUR FORECAST LOW DISSIPATED. TROUGH FROM 12N1771 TO 09N168E 
      TO 03N165E. 
      .48 HOUR FORECAST TROUGH MOVED W OF AREA. 
      
      .FRONT FROM 30N174E TO 25N160E MOVING E 20 KT N OF 29N AND NEARLY
      STATIONARY ELSEWHERE. 
      .24 HOUR FORECAST FRONT FROM 30N168W TO 29N177W TO 30N175E.
      .48 HOUR FORECAST FRONT DISSIPATED. 
      
      .NE TO E WINDS 20 TO 30 KT ENTIRE AREA FROM 05N TO 22N...AND
      FROM 22N TO 27N E OF 156W.
      .24 HOUR FORECAST NE TO E WINDS 20 TO 30 KT FROM 05N TO 26N 
      W OF 167W...FROM 05N TO 22N BETWEEN 167W AND 150W...AND FROM 10N 
      TO 23N E OF 150W. 
      .48 HOUR FORECAST NE TO E WINDS 20 TO 30 KT IN AREA BOUNDED BY A 
      LINE FROM 25N160W TO 16N148W TO 07N150W TO 06N164W TO 06N176E TO 
      13N160E TO 20N160E TO 21N175E TO 26N174W TO 25N160W. 
      
      .48 HOUR FORECAST NEW COLD FRONT THROUGH 30N160E. 
      
      .RIDGE FROM 30N169W TO 28N172E MOVING E 15 KT...AND GRADUALLY 
      ERODING FROM THE W. 
      
      .SEAS 12 TO 14 FT FROM 06N TO 20N BETWEEN 147W AND 167E. ELSEWHERE 
      SEAS 8 TO 12 FT ENTIRE AREA...EXCEPT SEAS 8 FT OR LESS S OF A LINE 
      FROM 10N160E TO 00N174E.
      .24 HOUR FORECAST SEAS 12 TO 14 FT FROM 05N TO 22N W OF 154W. 
      ELSEWHERE SEAS 8 TO 12 FT ENTIRE AREA...EXCEPT SEAS 8 FT OR LESS 
      S OF A LINE FROM 08N160E TO 00N177E...AND S OF A LINE FROM 08N140W 
      TO 00N160W. 
      .48 HOUR FORECAST SEAS 12 T0 15 FT FROM 05N TO 18N BETWEEN 154W AND 
      172E...AND FROM 10N TO 18N W OF 172E. ELSEWHERE SEAS 8 TO 12 FT 
      ENTIRE AREA...EXCEPT SEAS 8 FT OR LESS S OF A LINE FROM 08N160E TO 
      00N175E...AND S OF A LINE FROM 08N140W TO 00N150W. 
      
      .REMAINDER OF AREA WINDS 20 KT OR LESS. SEAS 8 FT OR LESS.
      
      .ITCZ FROM 08N140W TO 06N155W TO 04N170W. SCATTERED MODERATE TSTMS
      FROM 04N TO 08N BETWEEN 153W AND 159W. ISOLATED MODERATE TSTMS
      FROM 03N TO 07N BETWEEN 162W AND 171W. 
      
      $$
      
      .FORECASTER BIRCHARD. HONOLULU HI.

      My question, If you go to the text above you will see “.24” throughout the text. I want to strip from the “.24 to the next
      /linebreak without having to type out word for word or use “………” btw Idk how to tag my code…I’m using powershell

    • #129488
      Senior Moderator
      Topics: 9
      Replies: 1265
      Points: 4,582
      Helping Hand
      Rank: Community Hero

      Please post this question in General Q&A Forums using below link. This forum is dedicated for Pester related queries.

      General PowerShell Q&A

      You can use (pre) and (/pre) tags to format you code , remove brackets with ankle brackets.

      • #129528
        Participant
        Topics: 2
        Replies: 2
        Points: 18
        Rank: Member

        Ok thanks reposted to the general forum…couple of questions I don’t know what you are referring to the (pre) and (/pre) are you saying I need to use them for my url document or my powershell script?  Also What brackets do I need to remove and replace with angle brackets?

        thanks!

    • #129600
      Senior Moderator
      Topics: 9
      Replies: 1265
      Points: 4,582
      Helping Hand
      Rank: Community Hero

      Please refer this to format the code when posting in the forums here.

      https://github.com/kvprasoon/Images/blob/master/PowerShell/PSHORG_codePosting.gif

Viewing 2 reply threads
  • The topic ‘stripping texts ".24 to "’ is closed to new replies.