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

Re: What one-liners do people actually use?

by Siddartha (Curate)
on Dec 09, 2005 at 00:13 UTC ( #515427=note: print w/replies, xml ) Need Help??

in reply to What one-liners do people actually use?

I sometimes pipe stuff through the following one liner for utf8 conversion:
cat my_file | perl -e 'use Encode "from_to"; while (<>) {my $s = $_; f +rom_to($s,"iso-8859-1","utf8"); print $s}'

Replies are listed 'Best First'.
Re^2: What one-liners do people actually use?
by BrowserUk (Patriarch) on Dec 09, 2005 at 07:20 UTC

    You can save yourself a bit of typing there:

    perl -MEncode=from_to -pe"from_to( $_, 'iso-8859-1','utf8' )" infile > + outfile

    Switch the quotes on *nix.

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^2: What one-liners do people actually use?
by Your Mother (Archbishop) on Dec 09, 2005 at 07:09 UTC

    Nice++. I was going to ask about something like this on SOPW the other day but was a bit embarrassed b/c I knew there must be a super simple way that I ought to be able to figure out myself.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-08-15 09:28 GMT
Find Nodes?
    Voting Booth?

    No recent polls found