J
Jie
I am thinking if there is a way to append strings to the right in
perl.
for example, i want to create an output file like below:
A X
B Y
C Z
based on the following 2 arrays.
@array_1 = ("A", "B", "C");
@array_2 = ("X", "Y", "Z");
I am thinking to write some code like below:
#############################
@arrays = ("array_1", "array_2")
foreach $array (@arrays) {
open OUTPUT ">>final_file.txt";
$this_column ="";
foreach (@{$array}) {
$this_column .= $_;
}
print OUTPUT $this_column;
}
##############################
however, apparently, the above code will generates something like
below, instead of what i desired.... So, please help!!!! A temporary
2-dimentional array might not be a good idea though, because my real
data is really big....
A
B
C
X
Y
X
perl.
for example, i want to create an output file like below:
A X
B Y
C Z
based on the following 2 arrays.
@array_1 = ("A", "B", "C");
@array_2 = ("X", "Y", "Z");
I am thinking to write some code like below:
#############################
@arrays = ("array_1", "array_2")
foreach $array (@arrays) {
open OUTPUT ">>final_file.txt";
$this_column ="";
foreach (@{$array}) {
$this_column .= $_;
}
print OUTPUT $this_column;
}
##############################
however, apparently, the above code will generates something like
below, instead of what i desired.... So, please help!!!! A temporary
2-dimentional array might not be a good idea though, because my real
data is really big....
A
B
C
X
Y
X