LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 07: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, 07:59 AM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,178
Blog Entries: 10

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

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
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, 04:46 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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 04:59 PM.
 
Old 11-30-2015, 05:17 PM   #5
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 514

Rep: Reputation: 48
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 06:20 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:11 AM
[SOLVED] How to remove leading zeros in a function santosh0782 Linux - Newbie 5 03-05-2014 04:53 AM
BASH: Keeping/replacing leading zeros with BC Checksumfail Programming 3 07-20-2012 04:29 PM
How to add leading zeros to numbers for file names rootaccess Linux - General 20 06-16-2012 08:35 PM
Renaming files (adding leading zeros) General Linux - Software 3 01-09-2011 10:17 AM


All times are GMT -5. The time now is 11:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration