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:
It is required by my company. All the format should be the same as the original one.
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
This adds double quotes around all your text values. When output to csv, it looks like this
Dan
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?
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.
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?
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?
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?