powershell - Replace end of line with datestamp -
i'm trying prep file database import using powershell script. http://s000.tinyupload.com/index.php?file_id=38619771487389595658
i'm trying remove first line , add date stamp end of line. have been trying:
$date = get-date -format "dd-mm-yyyy hh:mm:ss" (get-content example.csv) | foreach-object {$_ -replace "`r`n", $date } | select -skip 1 | set-content result.csv ideally, i'd append date , comma, i've tried "test" value replace , still doesn't add anything.
give shot ... use + operator append end of each line. example appends comma , date.
$date = get-date -format 'dd-mm-yyyy hh:mm:ss'; get-content example.csv | % { $_ + ',' + $date } | select -skip 1 | set-content result.csv;
Comments
Post a Comment