此代码在上述日期之后搜索并递归复制文件.
#!/bin/bash
directory=~/somefolder
DAYSAGO=8
for ((a=0; a <= DAYSAGO ; a++))
do
find $directory -mtime $a -type f | while read file;
do
cp "$file" -t ~/The\ other\ folder/
done
done
Run Code Online (Sandbox Code Playgroud) 下面的代码不起作用
library(officer)
library(magrittr)
read_docx("/home/user/document.docx") %>%
body_replace_all_text("placeholder1", "text1") %>%
print(target = "/home/user/out.docx")
Run Code Online (Sandbox Code Playgroud)
输出:
在文档中找到 0 个 'placeholder1' 实例。
但是如果我使用字符串“tjsdhgudfhgku”而不是“placeholder1”,它就可以工作。
文档.docx:
tjsdhgudfhgku
placeholder1 blahblahblah
blah-blah
Run Code Online (Sandbox Code Playgroud)
为什么这样?