export-csv changes cell value with export-csv ...but value is correct in txt


hello.  thanks time.  i had question in regards how spit out result.  i exporting computer systems information users. when export using export-csv cell values overwritten excel numeric value (i.e. if serial number 12346789449 ... excel changes 1.4e2 ... don't want since ruining results.  when export text file result works not in column format.  so looking either excel stop converting value or how export in txt in column format.  i tried format-table no go.

machinetype          : desktop
machinename  : mycomputer
machinemodel         : dell
machineserial            : 134rfh44433
machineos            : windows

so how can column format?  thanks.

this no powershell problem! excel issue!

excel automatically convert formats other format during csv import.
includes numbers leading zeros, date / time conversions, currency , forth....

the way prevent excel of doing this, tell excel import values type of text:

http://stackoverflow.com/questions/165042/stop-excel-from-automatically-converting-certain-text-values-to-dates

http://superuser.com/questions/307496/how-can-i-set-excel-to-always-import-all-columns-of-csv-files-as-text

http://www.howtogeek.com/howto/microsoft-office/how-to-import-a-csv-file-containing-a-column-with-a-leading-0-into-excel/

http://risingline.com/use-excel-read-csv-without-reformatting.php


please click “mark answer” if post answers question , click “vote helpful” if post helps you.
bitte markiere hilfreiche beiträge von mir als “als hilfreich bewerten” und beiträge die deine frage ganz oder teilweise beantwortet haben als “als antwort markieren”.
powershell blog http://www.admin-source.info
[string](0..21|%{[char][int]([int]("{0:d}" -f 0x28)+('755964655967-86965747271757624-8796158066061').substring(($_*2),2))})-replace' '
german ? come german powershell forum!



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Group Policy Event ID 1058 Error Code 1326 (The user name or password is incorrect)

Suspicious event log Event ID: 4905

DCOM received error "2147746132" from...