Sponsored Content
Full Discussion: Sort Excel File
Top Forums Shell Programming and Scripting Sort Excel File Post 302547813 by eva13 on Tuesday 16th of August 2011 04:11:33 PM
Old 08-16-2011
It is an Excel file and NOT csv. I guess then perl module
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PERL: Split Excel Workbook to Indiv Excel files

Hi, I am trying to find a way to read an excel work book with multiple worksheets. And write each worksheet into a new excel file using perl. My environment is Unix. For example: I have an excel workbook TEST.xls and it has Sheet1, Sheet2, Sheet3 worksheets. I would like to create... (2 Replies)
Discussion started by: sandeep78
2 Replies

2. Shell Programming and Scripting

Perl script to sort an Excel file

Hello! I need to sort a file that is partly in English partly in Bulgarian. The original file is an Excel file but I converted it to a tab-delimited text file. The encoding of the tab delimited file is UTF-8. To sort the text, the script should test every line of the text file to see if... (9 Replies)
Discussion started by: degoor
9 Replies

3. Shell Programming and Scripting

How to sort columns in excel(csv) file

i want sort columns with headers based on another file headers file1 eg: i'm having an empty file with only coumn names like lastname firstname title expirydate stlcno status etc... another file with same column names and some other as well but in different order... file2 eg:firstname... (2 Replies)
Discussion started by: Man83Nagesh
2 Replies

4. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

5. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

6. Shell Programming and Scripting

Writing excel file using perl : Excel file formatting changed

I am trying to create a program where user can input data in certain excel cells using user interface on internet....the programming is on perl and server is unix But when i parse data into excel the formatting of sheets is turned to default and all macro coding removed. What to do...Please... (7 Replies)
Discussion started by: mud_born
7 Replies

7. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

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

9. UNIX for Beginners Questions & Answers

How to sort a column in excel/csv file?

I have to sort the 4th column of an excel/csv file. I tried the following command sort -u --field-separator=, --numeric-sort -k 2 -n dinesh.csv > test.csv But, it's not working. Moreover, I have to do the same for more than 30 excel/csv file. So please help me to do the same. (6 Replies)
Discussion started by: dineshkumarsrk
6 Replies
Sort::Key::Natural(3pm) 				User Contributed Perl Documentation				   Sort::Key::Natural(3pm)

NAME
Sort::Key::Natural - fast natural sorting SYNOPSIS
use Sort::Key::Natural qw(natsort); my @data = qw(foo1 foo23 foo6 bar12 bar1 foo bar2 bar-45 foomatic b-a-r-45); my @sorted = natsort @data; print "@sorted "; # prints: # b-a-r-45 bar1 bar2 bar12 bar-45 foo foo1 foo6 foo23 foomatic use Sort::Key::Natural qw(natkeysort); my @objects = (...); my @sorted = natkeysort { $_->get_id } @objects; DESCRIPTION
This module extends the Sort::Key family of modules to support natural sorting. Under natural sorting, strings are split at word and number boundaries, and the resulting substrings are compared as follows: o numeric substrings are compared numerically o alphabetic substrings are compared lexically o numeric substrings come always before alphabetic substrings Spaces, symbols and non-printable characters are only considered for splitting the string into its parts but not for sorting. For instance "foo-bar-42" is broken in three substrings "foo", "bar" and 42 and after that the dashes are ignored. Note, that the sorting is case sensitive. To do a case insensitive sort you have to convert the keys explicitly: my @sorted = natkeysort { lc $_ } @data Also, once this module is loaded, the new type "natural" (or "nat") will be available from Sort::Key::Maker. For instance: use Sort::Key::Natural; use Sort::Key::Maker i_rnat_keysort => qw(integer -natural); creates a multikey sorter "i_rnat_keysort" accepting two keys, the first to be compared as an integer and the second in natural descending order. There is also an alternative set of natural sorting functions that recognize floating point numbers. They use the key type "natwf" (abreviation of "natural_with_floats"). FUNCTIONS the functions that can be imported from this module are: natsort @data returns the elements of @data sorted in natural order. rnatsort @data returns the elements of @data sorted in natural descending order. natkeysort { CALC_KEY($_) } @data returns the elements on @array naturally sorted by the keys resulting from applying them "CALC_KEY". rnatkeysort { CALC_KEY($_) } @data is similar to "natkeysort" but sorts the elements in descending order. natsort_inplace @data rnatsort_inplace @data natkeysort_inplace { CALC_KEY($_) } @data rnatkeysort_inplace { CALC_KEY($_) } @data these functions are similar respectively to "natsort", "rnatsort", "natsortkey" and "rnatsortkey", but they sort the array @data in place. $key = mkkey_natural $string given $string, returns a key that can be compared lexicographically to another key obtained in the same manner, results in the same order as comparing the former strings as in the natural order. If the argument $key is not provided it defaults to $_. natwfsort @data rnatwfsort @data natkeywfsort { CALC_KEY($_) } @data rnatkeywfsort { CALC_KEY($_) } @data natwfsort_inplace @data rnatwfsort_inplace @data natkeywfsort_inplace { CALC_KEY($_) } @data rnatkeywfsort_inplace { CALC_KEY($_) } @data mkkey_natural_with_floats $key this ugly named set of functions perform in the same way as its s/natwf/nat/ counterpart with the difference that they honor floating point numbers embeded inside the strings. In this context a floating point number is a string matching the regular expression "/[+-]?d+(.d*)?/". Note that numbers with an exponent part (i.e. "1.12E-12") are not recognized as such. Note also that numbers without an integer part (i.e. .2 or "-.12") are not supported either. SEE ALSO
Sort::Key, Sort::Key::Maker. Other module providing similar functionality is Sort::Naturally. COPYRIGHT AND LICENSE
Copyright (C) 2006, 2012 by Salvador Fandin~o, <sfandino@yahoo.com>. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2012-06-30 Sort::Key::Natural(3pm)
All times are GMT -4. The time now is 12:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy