in reply to printing contents of small files into one larger one
Update: Simplified. No need for an array or any fancy joining!#! /usr/bin/perl use strict; use warnings; my @line; while (<>) { chomp; push @line, "$_"; } continue { if (eof) { print join("\t", @line), "\n"; @line = (); close ARGV; } }
while (<>) { chomp; if (eof) {print "$_\n"} else {print "$_\t"} }
The order that the files are appended is taken from the order in which they are listed in @ARGV. This can be sorted before the files are processed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: printing contents of small files into one larger one
by virtualsue (Vicar) on Nov 09, 2005 at 13:59 UTC | |
by inman (Curate) on Nov 09, 2005 at 17:12 UTC | |
|
Re^2: printing contents of small files into one larger one
by mlh2003 (Scribe) on Nov 09, 2005 at 12:41 UTC |