小编mkr*_*use的帖子

移动文件并将日期添加到文件名

#!/bin/bash
while read server <&3; do   #read server names into the while loop    
  if [[ ! $server =~ [^[:space:]] ]] ; then  #empty line exception
    continue
  fi   
  echo "Connecting to - $server"
  #ssh "$server"  #SSH login
  while read updatedfile <&3 && read oldfile <&4; do     
    echo Comparing $updatedfile with $oldfile
    if diff "$updatedfile" "$oldfile" >/dev/null ; then
      echo The files compared are the same. No changes were made.
    else
      echo The files compared are different.
      # copy the new file …
Run Code Online (Sandbox Code Playgroud)

bash rename mv

4
推荐指数
1
解决办法
1万
查看次数

将文件名从循环文件写入文本文件

$fileEntries = [IO.Directory]::GetFiles("C:\Users\U0146121\Desktop\Example Data"); #where the file is located.
foreach($fileName in $fileEntries) 
{ 
 #write the file name to a text file.  
}  
Run Code Online (Sandbox Code Playgroud)

我需要将文件名写入循环中的文本文件,但我不知道如何.

最后,我将读取文本文件并在excel中搜索文件名.但是现在我必须首先编写.txt文件.

powershell

4
推荐指数
1
解决办法
9329
查看次数

标签 统计

bash ×1

mv ×1

powershell ×1

rename ×1