cancel
Showing results for 
Search instead for 
Did you mean: 

Collection to CSV - Custom Delimiters

MatthewRoss
Level 4
Hi All, I am looking at ways to write a collection to a csv file using custome delimters (changes for different processes, to upload to different systems). There is a standard object - Utility - Strings (Get collection as CSV) but this defaults using a comma as the delimiter. It has this code - Dim SB As New StringBuilder WriteDataTable(SB, Input_Collection, True) Output_CSV = SB.ToString()   The WriteDataTable function can i pass it a custom delimter by chance? If not another way to achive this without the need for excel stepping stone? Thanks MoD  
2 REPLIES 2

AndreyKudinov
Level 10
No, "WriteDataTable" is in Global code of the VBO and it has no way to pass a separator (and has other issues actually). You better make your own that suits your needs. You can probably use WriteDataTable or solution from this thread as a start, replacing "," with ";","\t" or whatever or just fine a better ones on stackoverflow. Or you can use some net library, but that adds dependencies, which is not good unless you really need RFC4180 compilant solution with every possible pitfall already though of. 

MatthewRoss
Level 4
Hi aikudino, thanks for the info! I've previously checkted the thread you have linked but couldnt figure out how to add that to the code node in BP, left a comment on that thread about it. MoD