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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -