如何使用PowerShell删除具有多个文件夹的文本文件中的特殊字符?

时间:2018-11-12 03:00:42

标签: powershell powershell-v4.0

我有PowerShell 4.0。我的问题是有10个文件夹,每个文件夹包含300个文本文件。在300个文本文件中,几乎有150个文件为空,但具有独特的特殊字符。我用Notepad ++打开每个文件,字符为“ EXTNULL”。我用记事本打开,字符就像“ L”。因此,我无法加载它们。

如何使用PowerShell 4.0删除特殊字符?

文件夹如下:

C:/temp/file1_extracted
c:/temp/file2_extracted
c:/temp/file3_extracted
...
c:/temp/file10_extracted
This Format-Hex is working in Powershell 5.0 and above but I have 4.0
Get-Content -path "C:\temp\file1_extracted\file1.txt" | Format-Hex

Here is the symbol for the special characters:
Offset Bytes  Path
------ ----- ----
0 {3, 0} 

0 个答案:

没有答案
相关问题