cancel
Showing results for 
Search instead for 
Did you mean: 

Split string into rows and save it to file row by row, not in one string

SL12345
New Contributor III

Lets say i have this input string in my mapper:

"Mercedes;6658;TypeS;2022;\r\nAudi;5558;TypeA8;2022;Diesel"

How can i save it to csv file as single rows? in this example it should be:

Mercedes;6658;TypeS;2022;
Audi;5558;TypeA8;2022;Diesel

I've tried myString.split('\r\n') it creates two strings which i can not export/save as file because its list, or these strings were comma separated and stored as one line in export file

Thank you for your help

1 ACCEPTED SOLUTION

Try with this one.

View solution in original post

6 REPLIES 6

Aleksandar_A
Contributor III

Hello @SL12345,

Please refer to the attached sample pipeline, and let me know if this helps you!

Regards,

Aleksandar.

SL12345
New Contributor III

Looks good but question .... in my example  - one row has more fields than another row

Is it possible to "connect"/export two  lines into one file but without empty field at the and of shorter row? 

(Mercedes is shorter and CSV formatter creates last empty field) instead of this:
"Mercedes";"6658";"TypeS";"2022";""
"Audi";"5558";"TypeA8";"2022";"Diesel"

get This

"Mercedes";"6658";"TypeS";"2022";
"Audi";"5558";"TypeA8";"2022";"Diesel"

Thank you

 

Try with this one.

SL12345
New Contributor III

This works for my example really well 🙂 

 

Sorry but last