作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
背景
我有一个像这样的文件名file
:
something.txt
another.cpp
whoa.cxx
...
./something.txt.docx
./another.cpp.docx
./whoa.cxx.docx
cat file | touch <not sure what to put here>.docx
。cat file | xargs -I{} touch {}.docx
-I replace-str
Replace occurrences of replace-str in the initial-arguments with names read from standard input. Also, unquoted blanks do not terminate input items; instead the separator is the newline character. Implies -x and -L 1.
xargs: .docx: No such file or directory
。 最佳答案
假设文件内容格式合理,并且没有奇怪的情况,您可以执行以下操作:
while IFS= read -r line; do
touch "$line.docx"
done < input-file-name.txt
关于linux - 如何遍历文件以创建一系列新的.docx文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58597046/
我是一名优秀的程序员,十分优秀!