in reply to Re^4: How do you create a tab delimited txt file from two files?
in thread How do you create a tab delimited txt file from two files?

A slight mod to BrowserUk's code is what you need:
#!/usr/bin/perl -w use strict; open ONE, '<', "one.txt" or die "First File: $!\n"; open TWO, '<', "two.txt" or die "Second File: $!\n"; until( eof( ONE ) and eof (TWO)) { my $one = <ONE>; my $two = <TWO>; $one ||= ""; $two ||= ""; chomp($one); chomp($two); print "$one\t$two\n"; } __END__ OUTPUT: a this is 0 file two ab dsf one.txt: a 0 ab dsf two.txt: this is file two

Replies are listed 'Best First'.
Re^6: How do you create a tab delimited txt file from two files?
by elef (Friar) on Jul 29, 2010 at 15:52 UTC
    Indeed that seems to be just what I was looking for, thanks.