LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to retain leading zeros in excel when sending through mail (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-retain-leading-zeros-in-excel-when-sending-through-mail-4175560212/)

harekrushna 11-30-2015 07:35 AM

how to retain leading zeros in excel when sending through mail
 
Hi Guys,

I am sending an excel attachment in mail through shell script. It is successfully working but its removing the leading zeros.

For example one value of a column is "001465" but when I receive the excel sheet in my mail I found that the value has become "1465".

Can anyone please help me how to retain those leading values ?

Thanks in advance!!!!!

Habitual 11-30-2015 07:59 AM

Welcome to LQ!
Check the formatting of the cells in Excel on the receiving host.

grail 11-30-2015 09:26 AM

No mail program would alter the data of attachments by default. So the settings will be Excel driven by either the sender or receiver version.

John VV 11-30-2015 04:46 PM

for a MICROSOFT Excel .xlsx

open the current "student" MS office installed on windows 10 or in your Microsoft office 365 account on win10

and reset the cell space formatting in Microsoft office

should be "r-click" the column and select "format cell" set the leading zeros and the decimal places
and click on "optimize cell width"

vincix 11-30-2015 05:17 PM

Quote:

Originally Posted by harekrushna (Post 5457296)
Hi Guys,

I am sending an excel attachment in mail through shell script. It is successfully working but its removing the leading zeros.

For example one value of a column is "001465" but when I receive the excel sheet in my mail I found that the value has become "1465".

Can anyone please help me how to retain those leading values ?

Thanks in advance!!!!!

Don't use drag and drop. If you do, the mail client might alter the excel file.

[later edit:]
That might have been a stupid comment, given that you've said you're using a shell script. In Windows, for instance, Outlook might alter an excel file if you drag and drop it directly into the mail, instead of attaching it in the conventional way.

There's obviously no resemblance here to your problem, but perhaps you might try using a different mail client, just for the sake of it?:)


All times are GMT -5. The time now is 06:41 PM.