Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Keep string with double quotes showed in Notepad CSV output

Lichunhuang
7 - Meteor

Hi everyone, I have a question about CSV file.

In my original CSV file, string is double quotes, but Integer is not. While output the csv file, in output option, it can only select "always" to add double quotes in every cells, or "No" to remove all double quotes. Is there any way to keep the same format showed in Notepad as the original CSV file? Thank you!

There is the output I want:

 

Lichunhuang_0-1630689764076.png

 

11 REPLIES 11
atcodedog05
22 - Nova
22 - Nova

Hi @Lichunhuang 

 

Can I ask the reason why you need it?

Lichunhuang
7 - Meteor

It is required by my company. All the format should be the same as the original one.

danilang
19 - Altair
19 - Altair

Hi @Lichunhuang 

 

If you need a specific format in your csv file that's not one of the default Alteryx ones, you'll have to build the values directly into your fields and then output the results as csv never quoting output fields

 

To get the result you're looking for you can use a Multifield Formula tool configured like this

danilang_1-1630849550251.png

 

This adds double quotes around all your text values.  When output to csv, it looks like this

danilang_2-1630849675693.png

 

Dan

 

binay2448
11 - Bolide

Find attached workflow may be it will help, Not sure if you are looking for this only...

 

It is working fine for me when I selected "Auto" in "Quote Output Fields".

Lichunhuang
7 - Meteor

Thank you! That works! But, there is a question, there are more than 500 hundred fields needed to be edited. By using this method, I have to change the data type manually. Is there any way to change them automatically?  

Luke_C
17 - Castor
17 - Castor

Hi @Lichunhuang 

 

You might be able to use the auto field tool to help with this. Alteryx will try to assign the most appropriate data type to each column. 

 

Auto Field Tool | Alteryx Help

Lichunhuang
7 - Meteor

Thank you Luke. By using Auto filed, the data size will be reduced. Eg: 00058 in my original file would be 58 in the final output. Is there anyway to keep it?

Lichunhuang
7 - Meteor

Sorry, there is another problem in my output. Because some of my fields contain comma, while selecting quote output fields as "never"  in the output tool, it shows:Error: Output Data (47): When Quote Mode is Never, field cannot contain a delimiter character (record #5506).

Is there anyway to fix it?

Luke_C
17 - Castor
17 - Castor

Hi @Lichunhuang 

 

For your first comment, Auto Field is alteryx's best guess. It sees 00058 as a number and therefor trims the leading zeroes to get the most efficient data type. Just unselect that field in the tool's configuration.

 

For your second point, you either need a different delimiter or you need to quote the value with the delimiter in it. It seems you have strict system requirements.. how would this system know that the comma isn't indicating the next field in this case? 

Labels
Top Solution Authors