Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985231]
help
Chatterbox?
[stevieb]: I'm learning that no matter how good a piece of software is at what it's supposed to do, it's a piece of shit without providing any API documentation. (Talking about C++ here currently). Seriously... write software for an embedded platform and make...
[stevieb]: ...you guess based on the sparse examples, and the header files that are spread out illogically?
[stevieb]: document the public facing functions/methods people... ALL OF THEM.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-05-28 23:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?