I am using PowerShell. To import a separate TAB file with headers. The generated file has several empty lines "" at the end of the first line of headers. PowerShell error with error:
"The argument cannot be processed because the value of the argument" name "is invalid. Change the value of the" name "argument and run the operation again"
because the title requires a name.
I am wondering if anyone has ideas on how to manipulate a file to remove double quotes or enumerate them using "1" "2" "3" ... "10", etc.
Ideally, I would not want to modify the original file. I thought something like this
$fileContents = Get-Content -Path = $tsvFileName $firstLine = $fileContents[0].ToString().Replace('`t""',"") $fileContents[0] = $firstLine Import-Csv $fileContents -Delimiter "`t"
But Import-Csv expects $ fileContents to become a path. Can I use it as a source?
source share