in reply to CSV and regular expressions
Input#!/usr/bin/perl -w # filename: catskiphead # Merge files skipping the first line from the seocnd file onwards my $line = 1; while(<>) { next if ($line++ == 0); $line = 0 if eof; print ($_); }
file1: header 1 2 3 file2: header 4 5 6 file3: header 7 8 9 <p><c>Usage: catskiphead file1 file2 file3
Output
header 1 2 3 4 5 6 7 8 9
cheers
SK
PS: Note that you can change the print to take file handles and also do any checking on the input records before you write out.
|
|---|