How would I open two files and join then into one file with file 1 output being column 1 and file 2 being column 2. for example:
file 1 looks like this
123455 c c
323333 c c
543212 c c
and
file 2 looks like this
fi1234 4 3
dtt234 4 3
3555t2 4 3
and i would want my joined file to look like this
123455 c c fi1234 4 3
323333 c c dtt234 4 3
543212 c c 3555t2 4 3
Ive tried something like the following which did not work.
This printed everything in file 1 three times. Thanks for any help.open(IN, "file1") || or die; open(IN2, "file2") || or die; open(OUT, ">>joinfile") || or die; for my $file1 (<IN>) { chomp $file1; for my $file2 (<IN2>) { chomp $file2; print OUT "$file1 $file2\n"; } }
In reply to joining to files into columns by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |