excel - Powershell,Excel搜索文件夹
解决方案
将 Excel 保存为 CSV 文件
然后在 PowerShell 中执行:
$csv = Import-Csv -Path 'X:\theFile.csv' -Header 'path','exists' -UseCulture
foreach ($item in $csv) {
$item.exists = if (Test-Path -Path $item.path) {'OK'} else {'error'}
}
# re-save the file
$csv | Export-Csv -Path 'X:\theFile.csv' -UseCulture -NoTypeInformation
最后双击该文件以在 Excel 中打开
推荐阅读
- python - 如何在 Plotly Dash 应用程序中水平放置图形?
- python - 为什么 Python 垃圾收集器似乎不适用于 AWSIotMQTTClient 实例?
- json - 绑定 JSON 以在 AngularJs 中为一对多关系构建动态表单,并在两个表中都有父子关系
- php - 发送 PHP 变量 - setInterval 只工作一次
- php - 如何在 Laravel 中将日期字符串更改为单词?
- java - OSMDroid - 如何设置两个瓦片源?
- node.js - 尝试使用 npx create-react-app 时出现超时错误
- vue.js - 如何从 Vuetify 的 v-data-table 中删除单击的行?
- javascript - css脚本工作但js脚本在Django中不起作用
- swift - 设置嵌套结构并通过 FireStore [Swift] 填充