Hello Everyone,
I am converting HTML to CSV using this process nodes and it's working fine. Although I can export data store entity to CSV- but there is different requirement, so I am not using this approach. Please see below screenshot.
Requirement: When I open that CSV file in Notepad++ I see this:
I need to remove these quotes in a file. How can I achieve this?Thanks
Discussion posts and replies are publicly visible
We can achieve this ting by using CSV file template in "Text doc from template smart service". It worked.
Sorry, yes now that you mention it, I did know that would be a workable alternative: namely, to create a (text) template that's actually a filename with ".csv" extension. Appian doesn't enforce the extension (and keeps the original) despite it being "text from template".
I reiterate my original warning that the file you're generating here is no longer an actual CSV file (despite the extension you're keeping), since the quoted fields are a part of the CSV file format for parsing sake. If you're lucky the resulting file might still parse correctly by a CSV reader.
Yes. Actually it was the same result of CSV file that I got before. Therefore, CSV file seems to be perfect and parsed properly, also in editor I can this file without quotes.
Can anyone guide how to remove these commas from this file? This file is basically a CSV file that I open in editor.
AFAIK those commas indicate the presence of columns (exported to the CSV) that didn't have any data in them. You could always just pass the text through some function that removes any comma(s) at the end of a line of text... but it might be more worth your time investingating why they're appearing in the first place.
= a!localVariables( local!data: pv!empDetails, local!uniqueName: union( local!data.name, local!data.name ), joinarray( a!forEach( items: local!uniqueName, expression: a!localVariables( local!currentUserIndices: wherecontains( fv!item, touniformstring(local!data.name) ), concat( union( local!data.name_txt, local!data.name_txt ) , ",", union( local!data.address_txt, local!data.address_txt ) , ",", local!data.dept, ",", local!data.side, ",", local!data.city, ) ) ), char(13) & char(10) ) )
Actually, it suddenly appears, Earlier it was working fine- although, I have checked the previous versions as well. But no difference in code. Can you(Mike Schmitt ) please go through the code?
it seems like it's adding a whole extra set of blanks at the end (along with the hardcoded commas you have separating them), though the exact cause is a little hard to tell without seeing an example value for "pv!empDetails".
I would definitely recommend creating an expression rule for this, vs adding the code directly within the process - this way we can utilize different test cases, etc, much more easily.
Good news on the Text Doc from Template working to retain a .csv extension, I could have swore I tried that unsuccessfully in the past - but guess not! Or it was ages ago
You can refer this one:
Yes, I have created a rule for the same. But for now i am just testing it directly. Anyways, I put a rule before proceeding this.