Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: dos2unix problem

by tune (Curate)
on Oct 09, 2001 at 21:02 UTC ( [id://117795]=note: print w/replies, xml ) Need Help??


in reply to dos2unix problem

I used to do the following from the shell:
$ cat dosfile.txt | tr -d "\r" > unixfile.txt

--
tune

Replies are listed 'Best First'.
Re: Re: dos2unix problem
by tommyw (Hermit) on Oct 09, 2001 at 21:40 UTC

    Arggh! Not the dreaded "cat a single file into a pipe" command!

    This can always be replaced more efficiently by simply redirecting STDIN on the recieving command. Thus the example becomes

    $ tr -d "\r" < dosfile.txt > unixfile.txt
    which saves (approximately :) one process and two file handles.

    Of course, if you've got two files, you simply can't do this. And if the pipeline command is being generated from a script, the ease of building it this way may outway the efficiency of avoiding the extraneous "cat"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 11:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found