Avatar of Anthony K O365
Anthony K O365
Flag for United States of America asked on

Trouble with CSV file

Here is what's happening: When I add quotes around the displaynames ("john smith") and save it as csv, when I open in notepad, it shows triple quotes around the names ("""john smith""") causing errors in my script. Some how the formatting is wrong when I save it. Even when I save it as a text file, it still shows triple quotation marks.

Any thoughts?
ExchangeMicrosoft Excel

Avatar of undefined
Last Comment
Anthony K O365

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mo_patel

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Patrick Matthews

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Anthony K O365

ASKER
I'm simply trying to import a csv into a powershell script. The csv is:

Name
"John Smith"
"Sue Jones"

Since the names contain spaces, I thought you needed to had either single or double quotes.
Akhater

you don't need to use quotes in the csv even if the name has spaces
David Carr

Are you using Import-CSV?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Anthony K O365

ASKER
Yes
David Carr

quotes are not needed in the CSV file.
SubSun

Are you adding this quotes manually? if yes it's not necessary. See the MS article for details.
Ref : http://technet.microsoft.com/en-us/library/ee176874.aspx

Attached sample CSV, when you run Import-CSV it should list as shown in the screenshot..
Import-CSVTest.CSV
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Anthony K O365

ASKER
Very good comments!

Thanks!