'PowerShell - Import-CSV - How can I keep leading zeros on all decimal numbers being imported
I am trying to perform changes to a existing CSV, such as keeping specific columns (and removing the rest). However when I use Import-CSV, the leading zeros on certain data is being converted from 0.123 to .123 and -0.456 to -.456. This is leading the program that will digest this information to reject it.
My code looks something like this:
Import-CSV $attachment | Select-object 'colum1', 'column2', column3' | Export-CSV $output
I appreciate any help you can provide. Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|