Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Perl Regex to Fix line feed issue

by mmittiga17 (Scribe)
on May 09, 2008 at 20:32 UTC ( [id://685764]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Regex to Fix line feed issue
in thread Perl Regex to Fix line feed issue

Thanks to all for their replies. Nothing seems to work. I am trying a different approach. if line ends in ^M and the next starts with ^M join lines. Then remove the ^M^M from middle of the line. Any thoughts?

Replies are listed 'Best First'.
Re^3: Perl Regex to Fix line feed issue
by shmem (Chancellor) on May 09, 2008 at 21:38 UTC

    untested:

    $/ = "\r\n"; while (<>) { if (s/^\r//) { $l .= $_; $l =~ s/\r\r//g; next; } else { print $l; $l = $_; } } print $l;

    although I don't know what the heck you are wanting to to with what files to what end.

    Could you show what you've tried? and perhaps some sample input?

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://685764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-28 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found