I disagree with diotalevi: not all "interesting lines" start with a dot. I can see that those lines can be wrapped. An example of the file I just downloaded using wget:
.WEDNESDAY...MOSTLY SUNNY. HIGHS IN THE LOWER 50S. EAST WINDS 5 TO 10 MPH. .WEDNESDAY NIGHT...MOSTLY CLEAR. LOWS IN THE UPPER 20S. EAST WINDS 5 TO 10 MPH. .THANKSGIVING DAY...PARTLY SUNNY. HIGHS IN THE LOWER 50S.
See the wrapping in or around the wind speeds?

I think one easy way to unwrap such a short file, is to first collect the block you want, and then split on the dots that start a line. Something like:

@ARGV = 'paz049.txt'; my $buffer = ''; while(<>) { if(s/^\.// .. /^$/) { $buffer .= $_; } } $buffer =~ s/\s+$//; $buffer =~ s/\n(?!\.)/ /g; my @lines = split /\s*\n\./, $buffer;

If I now print out all the data in @lines, I seem to get the proper result:

TONIGHT...BECOMING PARTLY CLOUDY. LOWS IN THE MID 20S. NORTHWEST WIND +S AROUND 5 MPH. TUESDAY...PARTLY CLOUDY IN THE MORNING...THEN BECOMING SUNNY. HIGHS IN + THE MID 40S. SOUTHWEST WINDS AROUND 5 MPH. TUESDAY NIGHT...CLEAR. LOWS IN THE MID 20S. SOUTH WINDS AROUND 5 MPH. WEDNESDAY...MOSTLY SUNNY. HIGHS IN THE LOWER 50S. EAST WINDS 5 TO 10 M +PH. WEDNESDAY NIGHT...MOSTLY CLEAR. LOWS IN THE UPPER 20S. EAST WINDS 5 TO + 10 MPH. THANKSGIVING DAY...PARTLY SUNNY. HIGHS IN THE LOWER 50S. THURSDAY NIGHT...INCREASING CLOUDS. A 30 PERCENT CHANCE OF SHOWERS. LO +WS IN THE MID 30S. FRIDAY...MOSTLY CLOUDY WITH A 30 PERCENT CHANCE OF SHOWERS. HIGHS IN T +HE LOWER 50S. FRIDAY NIGHT...MOSTLY CLOUDY. LOWS IN THE UPPER 30S. SATURDAY...PARTLY CLOUDY. HIGHS IN THE LOWER 50S. SATURDAY NIGHT...PARTLY CLOUDY. LOWS IN THE LOWER 30S. SUNDAY...PARTLY CLOUDY IN THE MORNING...THEN BECOMING SUNNY. HIGHS ARO +UND 50. SUNDAY NIGHT...PARTLY CLOUDY. LOWS IN THE MID 30S. MONDAY...DECREASING CLOUDS. HIGHS IN THE UPPER 40S.

In reply to Re: Editing a text file by bart
in thread Editing a text file by appletag

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.