0

I have problem to insert new data into existing file. The data must be placed at the end of the row.

Data to added:

1   255     1   0

I tried this way but couldn't.

| foreach { $_ + "`t 1 `t 255 `t 1 `t 0" } 

Here is my code right now:

Import-Csv -Path "C:\Users\.csv"| Select-Object "Person ID","Time" | Format-Table -HideTableHeaders -AutoSize | Out-File C:\Users\.csv

End Result:

1005   2019-02-01 06:44:31     1   255 1   0
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ryna
  • 1
  • 1
  • Instead of formatting, just pass along after Select-Object. Also, instead of out-file, use export-csv - depending on the csv format – Ketanbhut Sep 24 '19 at 04:43
  • Only ever use `Format-*` cmdlets for _display formatting_, never for _programmatic processing_ - see https://stackoverflow.com/a/55174715/45375 – mklement0 Sep 25 '19 at 01:48

0 Answers0