Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11601

Use Powershell to convert a text file into a csv file

$
0
0

If I have a simple text file showing user's first name, middle name (if available), last name, and email address, is there a quick way to convert this to a csv format using Powershell or maybe even Excel? The CSV file would only need to show the first name, last name (which could be a combination of middle name and last name), and email address.

For example, if I have a text file as follows:

James Tiberius Kirk       james.kirk@starfleet.comLeonard McCoy             leonard.mccoy@starfleet.com

I would like to convert to csv as follows:

FirstName,LastName,EmailAddressJames,TiberiusKirk,james.kirk@starfleet.comLeonard,McCoy,leonard.mccoy@starfleet.com

Am not sure how to do, other than manually, which is time consuming for large text files.


Viewing all articles
Browse latest Browse all 11601

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>