#!/usr/bin/perl -w use strict; open (INPUT,"jobs.txt") or die "Unable to open input : $!"; open (OUTPUT,"jobs.txt") or die "Unable to open output : $!"; select OUTPUT; $\ = "\n"; while () { chomp; my @fields = split /\t/; unless (@fields > 2) { print join "\t" , @fields; } else { my $firstfield = shift @fields; while (my $nextfield = shift @fields) { print $firstfield, "\t", $nextfield; } } } close INPUT; close OUTPUT;