Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: regexp for scalar containing a mixture of LF & CRLF

by Paladin (Priest)
on Dec 09, 2004 at 23:03 UTC ( #413711=note: print w/replies, xml ) Need Help??


in reply to regexp for scalar containing a mixture of LF & CRLF

What about something like:
s/\015?\012/\n/g;
Which will replace all LF and CRLF to whatever your local line ending character is.

Note: The /m modifier only affects the ^ and $ anchors, so is doing nothing in your RE since you have neither. The /s only affects what the . meta-character matches, and again, since you aren't using it, does nothing.

Replies are listed 'Best First'.
Re^2: regexp for scalar containing a mixture of LF & CRLF
by NateTut (Deacon) on Dec 09, 2004 at 23:56 UTC
    Thanks but it didn't work. See my next post for the ugly way I finally got it to work.

    Doug

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://413711]
help
Chatterbox?
[erix]: the annoying thing is that during setup of the 'foreign table' you have to specify all the columns. But that is reasonably automatable (just reading header line, and contruct the needed CREATE FOREIGN TABLE' statement)
[erix]: it may be easier to just slurp your fils into regular tables. Has other infrastructure advantages also (indexes, constraints etc)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2018-02-23 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (302 votes). Check out past polls.

    Notices?