Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Unix vs Windows Text File Format

by sgt (Deacon)
on Aug 05, 2010 at 22:14 UTC ( [id://853260]=note: print w/replies, xml ) Need Help??


in reply to Re: Unix vs Windows Text File Format
in thread Unix vs Windows Text File Format

You probably meant:

% perl -0015 -pe chomp infile > outfile # or even better % perl -0015 -pe 's{^\cZ$}{}; chomp' infile > outfile # deparse shows that -l0 cannot work % stephan@ape (/c/cygvar/tmp) % % perl -MO=Deparse -l0 -0015 -pe1 BEGIN { $/ = "\r"; $\ = "\000"; } LINE: while (defined($_ = <ARGV>)) { chomp $_; '???'; } continue { print $_; } -e syntax OK # checking % stephan@ape (/c/cygvar/tmp) % % echo abc def | xargs -n1 | perl -lpe '$_.="\cM"' | cat -evnt 1 abc^M$ 2 def^M$ % stephan@ape (/c/cygvar/tmp) % % echo abc def | xargs -n1 | perl -lpe '$_.="\cM"' | perl -0015 -pe ch +omp | cat -evnt 1 abc$ 2 def$
cheers --steph

Server Error (Error ID 7544608c2133076)

An error has occurred. The site administrators have been notified of the problem and will likely soon fix it. We thank you, for you're patients.

Replies are listed 'Best First'.
Re^3: Unix vs Windows Text File Format
by BrowserUk (Patriarch) on Aug 05, 2010 at 23:08 UTC
    You probably meant

    No. I meant what I posted, but as I indicated, I wasn't sure if it would work. Kinda hard to test without a working *nix environment and my VirtualBox/Ubunto is currently screwed. I hadn't thought of using Deparse.

    That said: this should work:

    perl -0777 -l -0015 -pe1 in >out

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-03-29 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found