有关 sed 's/\([0-9]*\) \([a-z]*\)/\2/w file1' file这里写成sed 's/\([0-9]*\) \([a-z]*\)/\2/w file\1' file 怎么不行呢 ? 也就是说输出的文件名根据提取不同的字符串而改变, 怎么才能达到这个目的?

来源:学生作业帮助网 编辑:六六作业网 时间:2024/09/18 11:39:43
有关sed''s/\([0-9]*\)\([a-z]*\)/\2/wfile1''file这里写成sed''s/\([0-9]*\)\([a-z]*\)/\2/wfile\1''file怎么不行呢?也就是说输

有关 sed 's/\([0-9]*\) \([a-z]*\)/\2/w file1' file这里写成sed 's/\([0-9]*\) \([a-z]*\)/\2/w file\1' file 怎么不行呢 ? 也就是说输出的文件名根据提取不同的字符串而改变, 怎么才能达到这个目的?
有关 sed 's/\([0-9]*\) \([a-z]*\)/\2/w file1' file
这里写成sed 's/\([0-9]*\) \([a-z]*\)/\2/w file\1' file 怎么不行呢 ? 也就是说输出的文件名根据提取不同的字符串而改变, 怎么才能达到这个目的?

有关 sed 's/\([0-9]*\) \([a-z]*\)/\2/w file1' file这里写成sed 's/\([0-9]*\) \([a-z]*\)/\2/w file\1' file 怎么不行呢 ? 也就是说输出的文件名根据提取不同的字符串而改变, 怎么才能达到这个目的?
sed应该不行
awk可以
awk -F " " '{filename="file"$1;print $2>>filename;}' file