Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
指定线长度powershell_Powershell_Powershell 3.0 - Fatal编程技术网

指定线长度powershell

指定线长度powershell,powershell,powershell-3.0,Powershell,Powershell 3.0,我需要使用powershell指定行长度。 我有一个具有不同行长的行的源文件,我需要将它们导出到一个具有所有相同行长的新文件470。 我找到了一个命令,但这将在行的前面添加一些空格,我需要在行的末尾添加空格 $sourcefile = '.\file.txt' foreach ($row in $sourcefile) { $row = [string]::Format("{0,469}",$row) | out-file '.\newfile.txt' -append } 使用负数指定给定空

我需要使用powershell指定行长度。 我有一个具有不同行长的行的源文件,我需要将它们导出到一个具有所有相同行长的新文件470。 我找到了一个命令,但这将在行的前面添加一些空格,我需要在行的末尾添加空格

$sourcefile = '.\file.txt'
foreach ($row in $sourcefile) {
$row = [string]::Format("{0,469}",$row) | out-file '.\newfile.txt' -append }

使用负数指定给定空间中的左对齐

例如

产出:

#43 # #43 #
使用负数指定给定空间中的左对齐

例如

产出:

#43 # #43 #
使用负数指定给定空间中的左对齐

例如

产出:

#43 # #43 #
使用负数指定给定空间中的左对齐

例如

产出:

#43 # #43 #
找到了!我需要用一个负数。{0,-496}找到了!我需要用一个负数。{0,-496}找到了!我需要用一个负数。{0,-496}找到了!我需要用一个负数。{0,-496}