You're viewing a comment by Nic and its responses.

May 09, 2011, 16:57

Here's a one-liner I wrote to fold every ten lines of STDIN to one on STDOUT:

perl -ple '$\ = $. % 10 ? "\t" : "\n"'

which just sets the output line terminator $\ to a tab except when the line number $. has no remainder when divided by 10.

Comment Responses

May 09, 2011, 17:09

This is awesome. Thanks for posting! If you have any more, post them here, I'll then put them in the ebook and perl1line.txt!

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "linux_256": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.