Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Is there a good way to unify text files something like dos2nix shell script(s) do?

by Laurent_R (Canon)
on Dec 20, 2013 at 18:54 UTC ( [id://1067979]=note: print w/replies, xml ) Need Help??


in reply to Is there a good way to unify text files something like dos2nix shell script(s) do?

Perhaps a starting point on trailing spaces and Windows carriage returns from the a*.pl files in the current directory:
$ perl -i.bak -pe 's/\s*[\r\n]+$/\n/g;' ./a*.pl

Replies are listed 'Best First'.
Re^2: Is there a good way to unify text files something like dos2nix shell script(s) do?
by taint (Chaplain) on Dec 20, 2013 at 19:04 UTC
    merci! Laurent_R.

    I use something similar, myself. But I'm not inclined to make any changes to any of the files, until I've managed to discover their encoding, and then change them (successfully) into utf-8. Otherwise, I often end up with "mojibake" -- Mojibake.

    Thanks again, for taking the time to reply, Laurent_R.

    --Chris

    Yes. What say about me, is true.
    

Log In?
Username:
Password:

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

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

    No recent polls found