I here have a simple input file
the first line is i/u, i stands for intersect and u stands for union
and the following two lines are numbers like this
2 3 5
4 6 7
if the first line is i
i
2 3 5
4 5 7
my output is suppose to look like this: 5
if the first line is u
u
2 3 5
4 5 7
my ouput is supposed to look like this: 2 3 4 5 7
(either sorted or not)
my questions is how to read the second and third lines at
the same time and compare it base on the conditon of the first line.
this is what i have so far
i know it is not right....
{
if($1=="i"{
print $0;
for(i=0;i<length($0);i++){
m=$i;
}
for(j=0;j<i;j++){
/m/ print $0;
}
}
#else print $0;
}
please help me!!!!!! thanks a lot...
the first line is i/u, i stands for intersect and u stands for union
and the following two lines are numbers like this
2 3 5
4 6 7
if the first line is i
i
2 3 5
4 5 7
my output is suppose to look like this: 5
if the first line is u
u
2 3 5
4 5 7
my ouput is supposed to look like this: 2 3 4 5 7
(either sorted or not)
my questions is how to read the second and third lines at
the same time and compare it base on the conditon of the first line.
this is what i have so far
i know it is not right....
{
if($1=="i"{
print $0;
for(i=0;i<length($0);i++){
m=$i;
}
for(j=0;j<i;j++){
/m/ print $0;
}
}
#else print $0;
}
please help me!!!!!! thanks a lot...