Katz
Katz

Reputation: 866

Import csv without double quotes

I have a database with several columns containing various data, I'm importing and exporting like so

$Col1= Import-CSV  C:\Users\Admin\Desktop\dbs.csv | select Col1 
$Col1|%{$(Get-Culture).TextInfo.ToTitleCase($_.GivenName)}
$Col1|  Export-Csv -NoTypeInformation   C:\Users\Admin\Desktop\Names.txt

When the file exports into the Names.txt each line contains double qoutes like so

"Category"
"Employees" 

Contents of the database

Col1 #Col1 is the header or the name of the column
Category
Employees
...
...

How can I remove those quotes when I export the data from the csv into a txt file?

Upvotes: 0

Views: 695

Answers (1)

dfundako
dfundako

Reputation: 8324

You can use Out-File when outputting to a .txt file

$Col1|  Out-file C:\Users\Admin\Desktop\Names.txt

Upvotes: 2

Related Questions