isahak
Programmer
- Dec 12, 2007
- 3
Hi everyone
My question is I have a text file, like this
123456 4
111111 8
666666 4
Now I want to read all these information into an array.
so I wrote,
arr[$1]=$2;
{
for(x in arr)
print x, arr[x];
}
my output is
123456 4
123456 4
111111 8
111111 8
123456 4
666666 4
111111 8
666666 4
123456 4
why is it like this. it should be
123456 4
111111 8
666666 4
So, does anyone know, how to solve this.
Thanks
My question is I have a text file, like this
123456 4
111111 8
666666 4
Now I want to read all these information into an array.
so I wrote,
arr[$1]=$2;
{
for(x in arr)
print x, arr[x];
}
my output is
123456 4
123456 4
111111 8
111111 8
123456 4
666666 4
111111 8
666666 4
123456 4
why is it like this. it should be
123456 4
111111 8
666666 4
So, does anyone know, how to solve this.
Thanks