Converting a *.txt document to a comma delimited file

Good afternoon,
    I'm currently outputting a text document using powershell select-string; however, I need to some how convert the *.txt document to a comma delmitied file.  Below is an example:

Within the *.txt document that I'm outputting its looks like the following:

Sample1=Sample1
Sample2=Sample2


Sample3=Sample3
Sample4=Sample4

It does include 2 returns in between each section.  I would like to take this data and create a csv file that is comma delimited.  
wnbtechnologyAsked:
Who is Participating?
 
Bryan ButlerCommented:
gc c:\FileWithEmptyLines.txt | where {$_ -ne ""} | %{$_ -replace "=",","} > newfile.txt

0
 
Bryan ButlerCommented:
Can you give an example of the results you want?  Something like this?

Sample1,Sample1
Sample2,Sample2
Sample3,Sample3
Sample4,Sample4

0
 
rab59718Commented:
I would import it to Excel and then save as CSV
0
 
wnbtechnologyAuthor Commented:
developedtester, you are correct that is the type of result that I would like to ouput to a comma delimitied file.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.