例如,在每行的末尾添加一个逗号:
$sku=Get-Content "D:\skulist.csv"
foreach ($skuLine in $sku) {
$newLine = $skuLine.Insert($skuLine.Length,",")
$newLine >> d:\newsku.txt
}
命令参数解释:
get-contet参考网址:http://technet.microsoft.com/library/4d594e54-2c28-4052-b3f8-1c27ea724561(v=wps.630).aspx
get-member参考网址:http://technet.microsoft.com/library/8201db21-0fa7-4862-a181-10b89d17d680(v=wps.630).aspx
$skuLine.Insert,$skuLine.Length,是指$skuLine的属性和方法,查看对象的方法和属性参考get-member命令;
转载于:https://blog.51cto.com/281816327/1599265
4万+

被折叠的 条评论
为什么被折叠?



