#!/bin/bash
> final.txt
echo "姓名,手机,QQ,专业" >> final.txt
echo "开始生成信息....."
sinfofile=`ls *.txt`
for file in ${sinfofile}
do
name=$(grep "姓名" $file | cut -d: -f
2)
2)
phone=$(grep "手机" $file | cut -d: -f
2)
2)
qq=$(grep "QQ" $file | cut -d: -f
2)
2)
major=$(grep "专业" $file | cut -d: -f
2)
2)
echo "$name,$phone,$qq,$major"
>> final.txt
>> final.txt
done
echo "信息生成完毕!!"
exit 0