Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: one liner?

by CountZero (Bishop)
on Aug 03, 2012 at 13:21 UTC ( #985231=note: print w/ replies, xml ) Need Help??


in reply to Re^2: one liner?
in thread one liner?

perl -F, -aple"$_ = join ',', @F[0 .. $#F-1], sprintf '%05d',$F[-1]" in.csv

This works even if each line has a different number of fields.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics


Comment on Re^3: one liner?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-08-01 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (10 votes), past polls