mysql - Problems with Hidden nulls in text output -
i'm having problems appears hidden null characters in text data trying extract wins server create list of machine names beginning s , 6 numbers.
input data like: s123456 [20h] dynamic active 1234567 unique 6/7/2014 ...
$output_file='d:\blah blah\workstations.txt' $regex='\b[s]\d{6}\b' select-string -path $input_path -pattern "active" |select-object line | ` select-string -pattern $regex -allmatches|%{$_.matches}|%{$_.value -replace "`r|`n",""}| get-unique > $output_file
when try load mysql table s null 1 null 2 null ... how can strip nulls out or avoid them?
here answer based on comment sequence above. can set encoding of output text file. built-in powershell commands write text files accept -encoding
parameter purpose. changing
> $output_file
to
| set-content -path $output_file -encoding utf8
will set file encoding specify.
Comments
Post a Comment