Since you have mentioned append, you can awk
as below
awk -F $' ' 'BEGIN {OFS = FS} NF==10{$0=$0"0"}1' input-file
The -F $' '
takes care of the tab-separation part, BEGIN {OFS = FS}
for setting the output field separation.
The NF==10
looks only for the lines having only 10 records and the {$0=$0"0"}1
for reconstructing that line with the extra word added.
To write to a separate file use the >
redirect operator as
awk -F $' ' 'BEGIN {OFS = FS} NF==10{$0=$0"0"}1' input-file > output-file
To replace the original file use mv
awk -F $' ' 'BEGIN {OFS = FS} NF==10{$0=$0"0"}1' input-file > output-file ; mv output-file input-file
Or if you have latest GNU Awk
(since 4.1.0
released), it has the option of "inplace" file editing:
gawk -i inplace -F $' ' 'BEGIN {OFS = FS} NF==10{$0=$0"0"}1' input-file
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…