How to change the format of an Excel from exponential to text through UNIX command?


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers How to change the format of an Excel from exponential to text through UNIX command?
# 1  
Old 10-18-2016
How to change the format of an Excel from exponential to text through UNIX command?

How to change the format of an excel from exponential to text through UNIX command


We have a pipe delimited file in which one particular A column is a combination of number+text and while converting into
excel using tr command it is generating a exponential data for the A column.

Kindly help to convert a file without generating the exponential value.

Input:
Code:
122911302435E289

Output:
Code:
1.22911302435E+300

UNIX script used for this convertion is shown below:

Code:
tr '|'  ',' < Input.csv > Final.csv

Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 10-18-2016 at 11:19 AM.. Reason: Added CODE tags.
# 2  
Old 10-18-2016
Welcome to unix.com!

In order to avoid misunderstandings and/or misinterpretations, take utmose care in phrasing your requests and supplying representative sample data.
I don't think you can "convert... into excel using tr command". tr can translate one text file into another, e.g. making it easier to read for EXCEL by replacing | chars with commas. That would still be an .csv file, i.e. text with a special structure.
When you write
Quote:
Output:

Code:
1.22911302435E+300
what is that output - certainly NOT the one by tr?

Did you consider the fact that within .csv- files, string/text fields are double quoted?
# 3  
Old 10-22-2016
Hi.

Dong a Google search for the words in the title How to change the format of an excel from exponential to text through UNIX command? provides about 500K results, among them, the (very) similar thread csv - How do I stop Excel from converting value 0503E000 to 5.03E+02 automatically? - Super User along with some solutions.

Best wishes ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

2. UNIX for Advanced & Expert Users

How to export Result to Excel Tabular format from UNIX?

Hi I am working on a script in which I am firing a query on database through Unix and getting the result set. I want to export that in an excel file. I am able to do so nut the result are exported horizontally one below the other. Can anyone plss help me out in exporting the Result in Tabular... (4 Replies)
Discussion started by: Saritau3
4 Replies

3. Shell Programming and Scripting

Problem with numbers in exponential format

Hi I have a shell scribt with some numbers in exponential format, for example, "1.23456789E +01" Now I would like to bring these numbers into a format without the E. Can someone help me Thanks Flo ---------- Post updated at 10:07 AM ---------- Previous update was at 09:14 AM... (1 Reply)
Discussion started by: sbfly
1 Replies

4. Shell Programming and Scripting

How to change date format in 'last' command?

hi.. i am new to here. can anybody tell me how can we change the date format in the 'last' command. EX- on running last command i am getting -- rruat pts/12 172.18.40.101 Tue May 3 12:59 still logged in rruat pts/10 blr2-3f-239.asco Tue May 3 12:59 - 13:09 ... (2 Replies)
Discussion started by: thearpit
2 Replies

5. Shell Programming and Scripting

exponential format

awk -F"\t" -vv1=$name 'BEGIN{OFS="\t"} {gsub ("http://www."v1".com","",$6);print $1"\t-\t-","",$6,$7,$9,$2,$14,$15"\t""Apache=-\t-",$8*1000000"\t-\t-\t-\tdeflate=-\trmt=-"}' file.txt > a.txt file.txt 144.130.7.153 www.chi.com - 18/Jul/2010:00:00:00 +0000 GET... (3 Replies)
Discussion started by: sandy1028
3 Replies

6. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

7. UNIX for Dummies Questions & Answers

Save Excel file as .txt in UNIX format

I have some files created in Excel that have to be saved as .txt files in order to load them into our accounting system. I can save the files as .txt files through Excel, but I then have to open them in TextPad and do a save as to change the Format from PC to UNIX. Is there a way to skip this step... (2 Replies)
Discussion started by: jroyalty
2 Replies

8. HP-UX

Conver Excel file to another format ( text)

I can convert a excel file to another format , for example text type ( TXT) whit anoter caracter from delimiter a rows ??? I can change the default delimiter " | " ( or space ) of cell to another caracter ( for example @@ or ## ) without change the other space ??? (6 Replies)
Discussion started by: ZINGARO
6 Replies

9. Shell Programming and Scripting

Issues in the Format in excel file generated from unix machine

Hi, I have generated a report that contains many columns and since I need ir in excel format.. I just renamed te file to excel as follows: cp vijay.txt vijay.xls I have just attached this spreadsheet in the mail and I am getting it to my mail id. But, in the output excel, the columns that... (10 Replies)
Discussion started by: Vijay06
10 Replies

10. Shell Programming and Scripting

How to format excel sheets in UNIX??

Hi, I have generated an excel sheet using a shell script. i have converted the output text file to an excel and got the desired output. However, in a particular column in the excel the values of the numbers start with 0. e.g. 078393343, 00342442, etc. But, in the resulting excel I get as... (2 Replies)
Discussion started by: Vijay06
2 Replies
Login or Register to Ask a Question