小编Ser*_*sov的帖子

如何使此代码更短更正确?(搜索和复制文件)

此代码在上述日期之后搜索并递归复制文件.

#!/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)

bash

3
推荐指数
1
解决办法
59
查看次数

包“officer”中的 body_replace_all_text() 方法不起作用

下面的代码不起作用

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)

为什么这样?

r officer

3
推荐指数
1
解决办法
403
查看次数

标签 统计

bash ×1

officer ×1

r ×1