Help on Shell Scripting - to store output to a fixed file

Hi
I have a file called "test.txt" and it looks like this
x
y
z
x/c
y/c/b
now, i want to run a command and its output will be like this
x 10
y/c/b 20
z 78

--------
my requirement is, i want to add the command output to "test.txt" as like below
x 10
y 0
z 78
x/c 0
y/c/b 20

please friends please help in this

Please refer your another thread with the same question.