Sponsored Content
Top Forums Shell Programming and Scripting Retaining the Unix CSV format in Excel format while exporting Post 302435013 by rawat_me01 on Tuesday 6th of July 2010 07:25:25 AM
Old 07-06-2010
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 i am using in Unix script but once it is exported to Excel the format gone and i am not getting the required format.

Any help would be useful here.
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

FORMAT OF CSV FILE under unix environment.

hi I unload the table results from oracle to csv file foramt. i need increse the width of each column using unix commands could you pl tell me how to increase the width of each column to spefic width uisng sed unix command or na other unix commands i have file name called report.csv inside... (38 Replies)
Discussion started by: raosurya
38 Replies

3. 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

4. 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

5. Shell Programming and Scripting

Remove duplicate commas after exporting excel file to csv

Hello everyone I'm new here and this is my first post so first of all I want to say that this is a great forum and I have managed to found most of my answers in these forums : ) So with that I ask you my first question: I have an excel file which I saved as a csv. However the excel file... (3 Replies)
Discussion started by: Spunkerspawn
3 Replies

6. UNIX Desktop Questions & Answers

Format csv file using Unix

Hi All, I have an csv file with three rows, where first containing header deatils. is there any way to make the first row to appear bold using UNIX command. Input File: Name Rank arun 1 babu 2 Expected Output: Name Rank arun 1 babu 2 (7 Replies)
Discussion started by: arunmanas
7 Replies

7. 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

8. Shell Programming and Scripting

UNIX command output in csv format

I'm just wondering is there any way to capture the output of a unix command in a csv format. df -h gives the result of filesystem,free space,Used space, use %,mounted on. Is there a way to capture the command output and format it as comma sparated or fixed length file. (3 Replies)
Discussion started by: anita81
3 Replies

9. 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

10. UNIX for Beginners Questions & Answers

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... (2 Replies)
Discussion started by: AbiramiRaja
2 Replies
Spreadsheet::ParseExcel::Cell(3pm)			User Contributed Perl Documentation			Spreadsheet::ParseExcel::Cell(3pm)

NAME
Spreadsheet::ParseExcel::Cell - A class for Cell data and formatting. SYNOPSIS
See the documentation for Spreadsheet::ParseExcel. DESCRIPTION
This module is used in conjunction with Spreadsheet::ParseExcel. See the documentation for Spreadsheet::ParseExcel. Methods The following Cell methods are available: $cell->value() $cell->unformatted() $cell->get_format() $cell->type() $cell->encoding() $cell->is_merged() $cell->get_rich_text() value() The "value()" method returns the formatted value of the cell. my $value = $cell->value(); Formatted in this sense refers to the numeric format of the cell value. For example a number such as 40177 might be formatted as 40,117, 40117.000 or even as the date 2009/12/30. If the cell doesn't contain a numeric format then the formatted and unformatted cell values are the same, see the "unformatted()" method below. For a defined $cell the "value()" method will always return a value. In the case of a cell with formatting but no numeric or string contents the method will return the empty string ''. unformatted() The "unformatted()" method returns the unformatted value of the cell. my $unformatted = $cell->unformatted(); Returns the cell value without a numeric format. See the "value()" method above. get_format() The "get_format()" method returns the Spreadsheet::ParseExcel::Format object for the cell. my $format = $cell->get_format(); If a user defined format hasn't been applied to the cell then the default cell format is returned. type() The "type()" method returns the type of cell such as Text, Numeric or Date. If the type was detected as Numeric, and the Cell Format matches "m{^[dmy][-\/dmy]*$}i", it will be treated as a Date type. my $type = $cell->type(); See also "Dates and Time in Excel". encoding() The "encoding()" method returns the character encoding of the cell. my $encoding = $cell->encoding(); This method is only of interest to developers. In general Spreadsheet::ParseExcel will return all character strings in UTF-8 regardless of the encoding used by Excel. The "encoding()" method returns one of the following values: o 0: Unknown format. This shouldn't happen. In the default case the format should be 1. o 1: 8bit ASCII or single byte UTF-16. This indicates that the characters are encoded in a single byte. In Excel 95 and earlier This usually meant ASCII or an international variant. In Excel 97 it refers to a compressed UTF-16 character string where all of the high order bytes are 0 and are omitted to save space. o 2: UTF-16BE. o 3: Native encoding. In Excel 95 and earlier this encoding was used to represent multi-byte character encodings such as SJIS. is_merged() The "is_merged()" method returns true if the cell is merged. my $is_merged = $cell->is_merged(); Returns "undef" if the property isn't set. get_rich_text() The "get_rich_text()" method returns an array ref of font information about each string block in a "rich", i.e. multi-format, string. my $rich_text = $cell->get_rich_text(); The return value is an arrayref of arrayrefs in the form: [ [ $start_position, $font_object ], ..., ] Returns undef if the property isn't set. Dates and Time in Excel Dates and times in Excel are represented by real numbers, for example "Jan 1 2001 12:30 PM" is represented by the number 36892.521. The integer part of the number stores the number of days since the epoch and the fractional part stores the percentage of the day. A date or time in Excel is just like any other number. The way in which it is displayed is controlled by the number format: Number format $cell->value() $cell->unformatted() ============= ============== ============== 'dd/mm/yy' '28/02/08' 39506.5 'mm/dd/yy' '02/28/08' 39506.5 'd-m-yyyy' '28-2-2008' 39506.5 'dd/mm/yy hh:mm' '28/02/08 12:00' 39506.5 'd mmm yyyy' '28 Feb 2008' 39506.5 'mmm d yyyy hh:mm AM/PM' 'Feb 28 2008 12:00 PM' 39506.5 The Spreadsheet::ParseExcel::Utility module contains a function called "ExcelLocaltime" which will convert between an unformatted Excel date/time number and a "localtime()" like array. For date conversions using the CPAN "DateTime" framework see DateTime::Format::Excel http://search.cpan.org/search?dist=DateTime-Format-Excel AUTHOR
Maintainer 0.40+: John McNamara jmcnamara@cpan.org Maintainer 0.27-0.33: Gabor Szabo szabgab@cpan.org Original author: Kawai Takanori kwitknr@cpan.org COPYRIGHT
Copyright (c) 2009-2010 John McNamara Copyright (c) 2006-2008 Gabor Szabo Copyright (c) 2000-2006 Kawai Takanori All rights reserved. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. perl v5.10.1 2010-09-17 Spreadsheet::ParseExcel::Cell(3pm)
All times are GMT -4. The time now is 07:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy