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
Agree with Mike we need more information on pv!empDetails. Is this single or multi-valued? If it is single, the unions in and a!forEach() are not necessary. If it is multiple, the unions are still confusing to me, and will likely confuse the output as well (and you should be using fv!item.dataPoint. Are you trying to reduce multiple exact rows into 1, etc?
It's multivalued. Actually data is coming right in multiple rows in CSV. The only thing is when I open this file in editor it shows commas at the end of array.
= a!localVariables( fv!item: pv!empDetails, joinarray( a!forEach( items: fv!item, expression: a!localVariables( local!currentUserIndices: wherecontains( fv!item, touniformstring(fv!item.name) ), concat( fv!item.name_txt, , ",", fv!item.address_txt, , ",", fv!item.dept, ",", fv!item.side, ",", fv!item.city, ) ) ), char(13) & char(10) ) )
You can also remove the a!localVariables from within the a!forEach since local!currentUserIndices is not used anywhere.
Additionally, note the extra commas within the concat after name, address.
Try this alone in the a!forEach expression - for safety you will want to remove commas from within each of the values as well, while they may not be likely, and single one will break your file (since we are no longer wrapping in quotes):
concat( stripwith(fv!item.name_txt,","), ",", stripwith(fv!item.address_txt,","), ",", stripwith(fv!item.dept,","), ",", stripwith(fv!item.side,","), ",", stripwith(fv!item.city","), )
Okay, thanks. let me try with this.
It's not working. Let's make it simple.I have checked when I delete last blank row in CSV file and save it. After that I open that csv file in editor and there were no commas.
I think we just need to remove blank row that is added as a last record in CSV. That's why it shows commas after last record in editor file.