Tuesday, 15 September 2015

PowerShell Tab Separated File Import and Blank Values -



PowerShell Tab Separated File Import and Blank Values -

i have changed script import info csv file tab separated file. issue having when there blank value in tab separated file in $var1 not treat $var either null or "", thinking there tab stored in variable, striped variabled containing tabs, same issue still occurring. tab separated file contains 6 columns , 5 rows , headers added when file imported using below command.

my question read tab separated file if 1 of columns blank?

command used import files contents. $list = import-csv c:\users\jsmith\documents\file.out -delimiter "`t" -header "id","date","first name","last name","gender"

try evaluating [system.dbnull]::value.

i typically assign variable create easy evaluate later:

$dbnull = [system.dbnull]::value if ($value -eq $dbnull) { # stuff }

powershell

No comments:

Post a Comment