Powershell. Increase value in CSV file or Array -


i have csv file looks like:

initials,size excl. backup/pst,number of warnings user1,100,1 user2,100,1 user4,400,2 

i increase value "number of warnings" 1 end with:

initials,size excl. backup/pst,number of warnings user1,100,2 user2,100,2 user4,400,3 

i have tried, not succeeded.
have tried putting in array, can't working.

$temp = import-csv $database | foreach {$_.'number of warnings' +1} 

but 2 things:
adds 1 end of number 1 becomes 11 , 2 becomes 21 (as string)
output "number of warnings" column - rest of information seems gone

this works :

$myreport = import-csv .\testing.csv  $myreport | %{$_.'number of warnings' = 1 + $_.'number of warnings'} 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -