LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2015, 06:35 AM   #1
harekrushna
LQ Newbie
 
Registered: Nov 2015
Posts: 1

Rep: Reputation: Disabled
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!!!!!
 
Old 11-30-2015, 06:59 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Welcome to LQ!
Check the formatting of the cells in Excel on the receiving host.
 
Old 11-30-2015, 08:26 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
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.
 
Old 11-30-2015, 03:46 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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"

Last edited by John VV; 11-30-2015 at 03:59 PM.
 
Old 11-30-2015, 04:17 PM   #5
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by harekrushna View Post
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?

Last edited by vincix; 12-01-2015 at 05:20 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Rename numerical filenames so all have the same number of leading zeros kmkocot Linux - Newbie 4 11-25-2014 12:11 AM
[SOLVED] How to remove leading zeros in a function santosh0782 Linux - Newbie 5 03-05-2014 03:53 AM
BASH: Keeping/replacing leading zeros with BC Checksumfail Programming 3 07-20-2012 03:29 PM
How to add leading zeros to numbers for file names rootaccess Linux - General 20 06-16-2012 07:35 PM
Renaming files (adding leading zeros) General Linux - Software 3 01-09-2011 09:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration