I have a tab separated text file after executing some command in powershell i want to convert this tab separated file into csv now how can i do so?
You can use the Export-Csv cmdlet to convert objects to CSV strings. Export-CSV is similar to ConvertTo-CSV , except that it saves the CSV strings to a file. The ConvertTo-CSV cmdlet has parameters to specify a delimiter other than a comma or use the current culture as the delimiter.
Go to File > Save As. Click Browse. In the Save As dialog box, under Save as type box, choose the text file format for the worksheet; for example, click Text (Tab delimited) or CSV (Comma delimited).
A tab separated text file could be treated as a CSV file with a tab instead of comma as its delimiter. To convert:
import-csv tabdelimitedfile.txt -delimiter "`t" | export-csv csvfile.csv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With