cut
perl -alpe'$_=$F[0]'
perl -alpe'$_="@F[1..3]"'
To create a custom input separator,
perl -F: -alpe'$_=$F[0]'
To change the output delimiter,
perl -F: -alpe'$"=":";$_="@F[1..3]"'
In grepwhile you are on it,
perl -alne'print$F[0]if/blah/'
paste
Not so easy.
for (@ARGV ? @ARGV : qw(-)) {
if ($_ eq '-') {push @files, *STDIN}
else {open $files[@files], '<', $_}
}
while (grep defined, (@lines = map scalar <$_>, @files)) {
chomp @lines;
print join("\t", @lines), "\n";
}
source
share