#!/usr/bin/perl -s use strict; my $count = 1; while (<>) { my @fields = split; print "@fields[0..16] ", $count++, " $fields[18]\n"; }