cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Inserting a line break while writing an excel file

darshthakkar
Valued Contributor

Hi Team,

Iโ€™m planning to write an excel file with statistics listed on it and Iโ€™ve been successful to record the counts from my previous snaps however at the end, the entire data comes as a long text which I would want to break it up.

For instance, Iโ€™m planning to write:
image

However, my output is coming as below:
image

Basically, I want line breaks in excel file Iโ€™m writing. Can we even achieve this in mapper snap?
Also, is it possible to define indentation (like Top/middle/bottom align, Left/Centre/Right align) while writing an excel file?

Thanking in advance for all the help ๐Ÿ™‚

Best Regards,
Darsh

7 REPLIES 7

alchemiz
Contributor III

Hi @darshthakkar ,

Good day, the line breaks I think is doable by means of excel formula

e.g.
image

then in the excel formatter snap checked the โ€œconvert the formula to excel formulasโ€

image

when open in excel

image

In excel you need to manually set the cell/s to wrap text

image

image

As for the worksheet attributes/settings/style maybe thereโ€™s a way in setting this configs from the excel metadata, to see the excel metadata create a copy of the excel file then rename that file to .zip then extract

Which document/schema/xml to update, that I have no idea ๐Ÿ™‚

e.g.

image

Thanks,
EmEm

Thank you @alchemiz for testing this out and sharing your insights, I really appreciate that.

Iโ€™m actually looking for no manual intervention once the flat files have been generated so I will have to research a bit on this. I did try something with csv files before however didnโ€™t find any luck with it.

The old post was Can we hyperlink inside a mapper snap? - #19 by darshthakkar

@alchemiz - If not line breaks, can we display it on a different row altogether? Thinking out loud as we wouldnโ€™t have to worry about the formulas, press enter after opening a flat file or select wrap text option.

ForbinCSD
Contributor

Just my two cents worth here: you definitely do not want to try to embed newlines within the interiors of fields in a CSV file.

Different programs parse CSV differently, but almost all of them treat the newline as an end-of-record terminator. That is, each line is a single record (regardless of using any quotiing or not).

I realize this next statement is โ€œpainting with an overly wide brushโ€, but in general, CSV is an โ€œokay but not greatโ€ data format for simple data interchange between systems, but NOT good for human-readable formatted data. Are you writing the formatted output as something like an XLSX file? You mentioned โ€œflat fileโ€ several times, and Excel is not โ€œflatโ€ so Iโ€™m not sure here.

(BTW, by โ€œokay but not greatโ€ I mean that are better formats for data interchange too, but often CSV is โ€œall youโ€™ve gotโ€ and you make do.)

Hey @ForbinCSD,

Thank you for your time, comments and sharing your perspective on this. I edited by post and replaced โ€œflat fileโ€ with an โ€œexcel fileโ€.
I agree that CSV is not good for human-readable formatted data but I wanted to understand whether line breaks were even achievable via an excel (preferred solution) or worst-case scenario (a CSV i.e. flat file)

The reason I edited my post is that, I agreed that using flat and excel would have created a confusion and I wanted to double down on excel approach. Frankly, even if line breaks are not achievable, it would be fine; I just have to compromise on the readability part, at the end of the day, I can still use an โ€œemail-senderโ€ snap and define my template accordingly on top of generating an excel file (as a backup)

Having said that, if Line breaks can be introduced, that is something I would learn from this thread as Iโ€™m not sure how to do that without any manual intervention after the file has been generated.

Thank you.