Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.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 - Fatal编程技术网

使用powershell命令处理文本文件中的数据

使用powershell命令处理文本文件中的数据,powershell,Powershell,我对PowerShell是新手。我想为文本文件中的每一行添加双引号和或,例如“word”或,并将结果输出到新文件中。到目前为止,我得到了这样的结果:%{“$\”或“},但它当然给了我以下错误:意外的令牌 嵌套双引号必须转义(PowerShell中的转义字符为反勾号): 嵌套双引号必须转义(PowerShell中的转义字符为反勾号): 非常感谢。现在,如何消除每行末尾的空白?。它。实际的文件在每个字符串的末尾都有空白,您如何使用PowerShell?。提前谢谢,我已经告诉过你了。如需进一步建议,请

我对PowerShell是新手。我想为文本文件中的每一行添加双引号和或,例如“word”或,并将结果输出到新文件中。到目前为止,我得到了这样的结果:
%{“$\”或“}
,但它当然给了我以下错误:
意外的令牌

嵌套双引号必须转义(PowerShell中的转义字符为反勾号):


嵌套双引号必须转义(PowerShell中的转义字符为反勾号):


非常感谢。现在,如何消除每行末尾的空白?。它。实际的文件在每个字符串的末尾都有空白,您如何使用PowerShell?。提前谢谢,我已经告诉过你了。如需进一步建议,请发布新问题。确保你包括样本输入和输出。我知道了!再次感谢,谢谢。现在,如何消除每行末尾的空白?。它。实际的文件在每个字符串的末尾都有空白,您如何使用PowerShell?。提前谢谢,我已经告诉过你了。如需进一步建议,请发布新问题。确保你包括样本输入和输出。我知道了!再次感谢。
% { "`"$_`" OR" }