Files
workspace/read_excel.ps1
aitest 15c4480db1 Add OpenClaw workspace configuration and tools
- Add agent configuration files (AGENTS.md, USER.md, IDENTITY.md, SOUL.md)
- Add git configuration and skills management scripts
- Add frontend/backend analysis tools and reports
- Add DingTalk media sender utilities and documentation
- Fix OpenClaw runtime environment (Node.js and Python)
- Configure git remotes and push scripts
2026-03-05 13:56:59 +09:00

39 lines
1.3 KiB
PowerShell

# 尝试读取 Excel 文件的简单方案
# 由于没有安装 Excel 读取库,使用 PowerShell 和其他方式
$envPath = "c:\work\data\env.xlsx"
Write-Output "Excel 文件路径: $envPath"
Write-Output "文件大小: $(Get-Item $envPath).Length bytes"
Write-Output "创建时间: $(Get-Item $envPath).LastWriteTime"
Write-Output ""
# 尝试作为二进制读取并查找文本
$bytes = [System.IO.File]::ReadAllBytes($envPath)
# 查找可能的 Git URL 或 GitHub 相关关键词
$text = [System.Text.Encoding]::UTF8.GetString($bytes)
$gitKeywords = @("git", "github", "repository", "repo", "git@", "https://", ".git", "ssh", "clone")
$foundKeywords = @()
foreach ($keyword in $gitKeywords) {
if ($text -like "*$keyword*") {
$foundKeywords += $keyword
}
}
Write-Output "找到的 Git 相关关键词: $($foundKeywords -join ', ')"
# 尝试查找 URL 模式
$urls = [regex]::Matches($text, "https?://github\.com/[^\s`"]+")
Write-Output "`n找到的 URLs:"
if ($urls.Count -gt 0) {
$urls | ForEach-Object { Write-Output " - $_.Value" }
} else {
Write-Output " 未找到 https://github.com/ 格式的 URL"
}
# 读取前 2000 个字符查看内容
Write-Output "`n文件前 2000 个字符:"
Write-Output $text.Substring(0, [Math]::Min(2000, $text.Length)))