CSV file pretty formatting

Hi everybody

I’m using the “create CSV advanced Module” to have some data exported into a CSV file.
This works just great. The results are like this:

image

Now I’m wondering if there’s a formatting option or a module that can help me format the data like this when I open the csv file:

image

Any help is appreciated! Thanks

Hi @chris99m
Yes this is possible
You can apply split function in each text with “,”
and then map the values into corresponding columns with get function

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

Thanks @Msquare_Automation for the reply!

Highly appreciate your advice, I just looked and found the get and split functions!

How do I include them here?

1 Like

@chris99m
image

I believe that the content is in one single cell for each row
if so you can get those rows and apply split function in a set variable as follows:


replace the text variable with the actual data you want to split


inside the columns you can get the corresponding values from the split array i.e x:

name: image
age:image
location:image
Relationship:image

3 Likes

What happens if there are multiple lines inside the csv module?

I kind of solved the problem by changing the Delimiter character to a semicolon. This happens because of Excel’s language settings.
In the english speaking version the Delimiter is set to “,” in other languages to “;”

However I would like to have a global approach. I want whoever opens the csv file to have the data split according to the columns. Thank you for explaining your approach - I think it might help I’ll try it out. :slight_smile:

1 Like

Hey there @chris99m :wave:

So awesome to hear that you solved this issue!

FYI: I marked your suggestion as a solution to keep the community organized and tidy for other users

1 Like