我花了一个多星期的时间研究这个问题,但所有帮助都没有奏效。我从这里开始:
$File = "C:\FOLDER\index - Copy.csv"
Import-Csv -Delim ',' $File |
ForEach-Object {$_.col1 = "C:\FOLDER\$($_.col1)"; $_} |
Export-Csv Index2.csv -Delim ',' -NoTypeInformation
我在此站点的其他位置找到了,并按预期进行了修改。但我收到此错误:
Exception setting "col1": "The property 'col1' cannot be found on this object. Verify that the property exists and can be set." At line:2 char:69 + Import-Csv -Delim ',' $File | ForEach-Object {$_.col1 = "C:\FOLDER\$($_.col1)";$_ ... + ~~~~~~~ + CategoryInfo : NotSpecified: (:) [], SetValueInvocationException + FullyQualifiedErrorId : ExceptionWhenSetting
我要做的就是获取一个看起来像这样的CSV文件:
Path,Filename 123456789,654321 234567891,543216 345678912,432165
并最终结束于此:
Path,Filename C:\FOLDER\123456789.jpg,654321.jpg C:\FOLDER\234567891.jpg,543216.jpg C:\FOLDER\345678912.jpg,432165.jpg