read and write file
dog 2003-07-01 06:17:53 有2个文件,要合并。
test1.txt
a
b
c
///////////////////////
test2.txt
a
salary
100
b
salary
1000
c
salary
23
////////////////////////
得到新的test1.txt
a
100
b
1000
c
23
有没有好的算法,我的是先读test1.txt一行得到a,找test2.txt中的a和它的值,写入临时文件,再重复读test1.txt到完,将临时文件写回test1.txt。