Trim CSV output
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Is it possible to trim only the first and the last record of a CSV output and delete all the other commas and keep delimiters?
Please find the screenshots for reference.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @Pratham @DavidP for your solutions.
So I have got rid of the trailing commas in the first and the last records however while outputting the records to csv the entire record is now coming under a quote. See below for reference.
I suspect when I will upload this file to any other system the entire record will only be considered as 1 field, which is not what I expect. Is there any way these quotes can be removed, so my fields aren't treated as single field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@shilpamehta1991 wrote:Thanks @Pratham @DavidP for your solutions.
So I have got rid of the trailing commas in the first and the last records however while outputting the records to csv the entire record is now coming under a quote. See below for reference.
I suspect when I will upload this file to any other system the entire record will only be considered as 1 field, which is not what I expect. Is there any way these quotes can be removed, so my fields aren't treated as single field?
Well in the Output tool configuration of the CSV file, Alteryx does allow you to unquote your output fields, provided the delimiter you choose for your output file is not present in the records. This clearly not possible in your case, since you have the delimiter in the records.
So a simple workaround for this is to change the delimiter of your output file, let's say to a pipe character "|", just for the Output tool's sake and have the tool output your file with the "Quote output fields" option set to "Never".
Your output file still gets to be a comma-separated CSV file.
Have a look at the configuration and output below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi @Pratham , I tried your solution, looks good to me.
Will try to upload on other system to see if gets through as well.
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @shilpamehta1991 , @Pratham
As opposed to specifying an artificial pipe "|" character as the field delimiter, Alteryx allows you to specify no delimiter "\0" in the output configuration.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

- « Previous
-
- 1
- 2
- Next »