I believe it's Excel eating up the leading zero-s.
Right click on attachment and open with something other than Excel.
Or save the attachment and then edit the saved file.
Shortly:
You have csv file which is something like:
And when you open in Excel by clicking your email attachment, the looks like:
It's Excel import default. I have not found any setup in Excel where you can change those defaults. So: M$ knows better what you need as you . If it looks number then it's number and you don't need leading 0's. If excel import string which include only numbers then it can't be string ...
If you like to keep those leading 0's in numbered string then you need import file to Excel:
* save your Attachment to some.csv
* Import a text file by opening it in Excel
* use wizard
* setup delimiter, setup those columns to text type, not default
And you have leading 0's. So they I have planned in Seattle. It have to be difficult to say that this is string, not number.
You can use example ssconvert to convert csv to xls including some defaults ..., but if you change those fields to excel string formattadding ' before values '00001,'00012 then ssconvert ex2.csv ex2.xls 2>/dev/null fields look nice including 0's and send it.
ssconvert can be installed to the Ubuntu and Debian:
The best solution:
Last edited by rbatte1; 01-16-2017 at 07:04 AM..
Reason: Changed some CODE tags to ICODE tags to ease the reading flow
Of course, adjusting the fields so that it looks correct in Excel (or other sreadsheet programs which do the same) means that you won't be able to do any calculations on them.
You might be better to import the data as real data without any adjustments and then format the cells (or the whole sheet if you want) to fix the width of the number including leading zeros. That way the display will be correct and the value will be still numeric so you can perform calculations.
I'm a newbie to shell scripting.
Can anyone help with the below requirement ?
The leading and trailing date of a files to be removed.
2017-07-12_gmr_tag_log_20170711.csv
2017-07-12_gmr_call_log_20170711.csv
2017-07-12_gmr_outgoing_log_20170711.csv
I'm looking for output like... (7 Replies)
I have a below file and I wanted to remove the leading zeros in each field separated by pipe
File:
01/09/2017|2017/09/06|2017/02/06|02/06/2017|02/06/2017 06:50:06 AM|2017/02/06|02/06/2017|02/07/2017 05:45:06 AM|
02/08/2017|2017/08/06|2017/09/06|02/05/2017|02/07/2017 05:40:06... (4 Replies)
Hello,
I have a pipe separated file with two major lines. One is header and another is detail line. Header starts with H and Detail start with D.
Sample Content:
H|123456|Joes Watson|UK|4/5/2016|12/5/2016|3456|HC|NW||||||
D|123456|Joes... (13 Replies)
I have a list of numbers extracted and need to delete the leading zeros from them, but when i do so, the command I am using also deletes numbers that end in Zero as well. eg 10, 20, 30, etc
this is part of a larger script and the only way I can think of is to try and detect the 10,20 30 etc in... (19 Replies)
Hello Gurus,
Quick question. I have a file with the following records:
A~000000000000518000~SLP ~99991231~20090701~88.50~USD~CS~
A~000000000000518000~SLP ~99991231~20090701~102.00~USD~CS~
A~000000000000772000~SLP ~99991231~20100701~118.08~USD~CS~
I wold like to do the following:
1. Add... (1 Reply)
I have a script which is taking a 10 character variable (BOC) input by the user. If it begins with a zero, the script unwittingly strips that off, & passes a 9 characters variable.
echo -n "Enter core-follow date/time for BOC: "
setenv BOC $<
The next bit of code picks up the 9... (4 Replies)
HEllo All,
when the data file is being attached and mailed as file1.csv, the column data( e.g: 88E00, 99E00, 77F12, 66H18).
The data 88E00 and 99E00 is being converted to 88E+01, 99E+01.
All other data is fine.
I need the file attached as .csv from unix only.
Is there a way we can manage... (2 Replies)
Hi
I have a file in which I have 5 columns which are delimited by “|” as shown
ABC|12|YAK|METRIC|000000019.5
XYZ|10|ABX|META|000000002.5
Now my requirement is to take the last column trim the leading zero's for that column values and write back to the same file in the same... (7 Replies)