Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sort file alphabetically AND numerically Post 302196144 by Perderabo on Friday 16th of May 2008 07:43:33 PM
Old 05-16-2008
Try:
sort -k 1,1 -k 2,2n f1 f2
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to sort alphabetically after finding values

I have a list of people in a usage log and need to print the names and phone numbers of people with over 500 logins. I'd also like to display these names alphabetically. I have their total logins set to a variable named total. So far, I have very little in my awk script to do this: FS=":"... (4 Replies)
Discussion started by: doubleminus
4 Replies

2. Shell Programming and Scripting

Numerically sort problem for a long list of file name

I got a long list of file name. My input: data_1.txt data_2.txt data_3.txt data_10.txt data_21.txt data_12.txt data_4.txt My desired output: data_1.txt data_2.txt data_3.txt data_4.txt data_10.txt data_12.txt data_21.txt Does anybody got idea how to archive it? (11 Replies)
Discussion started by: patrick87
11 Replies

3. Shell Programming and Scripting

Sort by numbers, then alphabetically

Hey guys, I have a file that contains the following: 366 K 364 Q 12 UB 7 INC. P 4 Law 2 LAMB 2 High 1 QEG 1 OF 1 LC 1 B As you can see, it's already sorted by numerical order, how do I sort it again, breaking the ties by using the alphabetical order of the second column, but... (2 Replies)
Discussion started by: Andrew9191
2 Replies

4. UNIX for Dummies Questions & Answers

Sort 2 columns numerically

Hi, A basic query. In the example file below, I want to sort by column 1 and then by column 2 numerically. I have tried sort -k2n,1 file1 but while this sorts the columns in the correct order, it does not sort column 2 numerically. Any help would be much appreciated. Also, if you have time to... (3 Replies)
Discussion started by: auburn
3 Replies

5. Shell Programming and Scripting

Sort numerically a non numerical

Hello, I have this sample data: 01 * * * * 01 * * * * 01 * * * * 01 * * * * 01 0 * * * 01 0 * * * 01 0 * * * 01 0 * * * 02 * * * 0 02 * * * 0 02 * * * 6 02 * * * 6 02 0 * * 1 02 0 * * 1 02 0 * * 2 02 0 * * 2 02 0 * * 3 (3 Replies)
Discussion started by: gio001
3 Replies

6. Shell Programming and Scripting

Sort alphabetically, then numerically

Greetings - I'm not necessarily new to bash scripting - I'm probably between beginner and intermediate, but I have something that I just cannot figure out after many attempts to find it. I have a file that is merely a list of many files, with their respective paths, and a branch path (ClearCase)... (5 Replies)
Discussion started by: 1cor29
5 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Reverse the order of a list of file names (but not sort them alphabetically or numerically)

Hello all, I have a list of file names in a text document where each file name consists of 4 letters and 3 numbers (for example MACR119). There are 48 file names in the document (they are not in alphabetical or numerical order). I would like to reorder the list of names so that the 48th name is... (3 Replies)
Discussion started by: MDeBiasse
3 Replies

8. Shell Programming and Scripting

Using awk to sort a file alphabetically

I have a problem with my homework I need to create a shell script using #!bin/awk -f the script will output the file in an alphabetical order only words and after the word is : after that a space then , then it will be numbered each character by which line its been for example CB 92A A... (1 Reply)
Discussion started by: collapse
1 Replies

9. UNIX for Dummies Questions & Answers

Sort alphabetically starting from specified letter

Hi. I'm trying to sort a list of items in a file alphabetically but starting from the letter 'X'. For instance if I had the following file; test.txt Z A T W Y B S X I would like the output to look like; X Y (8 Replies)
Discussion started by: mmab
8 Replies

10. UNIX for Beginners Questions & Answers

How to sort files in directory numerically?

Trying to sort a bunch of files numerically but can't seem to get the command just right. This is in a IBM AIX machine. I have a directory that has... backup.bk1 backup.bk100 backup.bk2 backup.bk200 backup.bk3 backup.bk300 There are a lot more files but this is shortened for the... (5 Replies)
Discussion started by: c3rb3rus
5 Replies
TFBS::SitePairSet(3pm)					User Contributed Perl Documentation				    TFBS::SitePairSet(3pm)

NAME
TFBS::SitePairSet - a set of TFBS::SitePair objects SYNOPSIS
my $site_pair_set = TFBS::SitePairSet->new(@list_of_site_pair_objects); # add a TFBS::SitePair object to set: $site_pair_set->add_site_pair($site_pair_obj); # append another TFBS::SitePairSet contents: $site_pair_set->add_site_pair_set($site_pair_obj); # create an iterator: my $it = $site_pair_set->Iterator(-sort_by => 'start'); DESCRIPTION
TFBS::SitePairSet is an aggregate class that contains a collection of TFBS::SitePair objects. It can be created anew and filled with TFBS::Site::Pair object. It is also returned by search_aln() method call of TFBS::PatternI subclasses (e.g. TFBS::Matrix::PWM). FEEDBACK
Please send bug reports and other comments to the author. AUTHOR - Boris Lenhard Boris Lenhard <Boris.Lenhard@cgb.ki.se> APPENDIX
The rest of the documentation details each of the object methods. Internal methods are preceded with an underscore. size Title : size Usage : my $size = $sitepairset->size() Function: returns a number of TFBS::SitePair objects contained in the set Returns : a scalar (integer) Args : none add_site_pair Title : add_site_pair Usage : $sitepairset->add_site_pair($site_pair_object) $sitepairset->add_site_pair(@list_of_site_pair_objects) Function: adds TFBS::SitePair objects to an existing TFBS::SitePairSet object Returns : $sitepairset object (usually ignored) Args : A list of TFBS::SitePair objects to add add_site_pair_set Title : add_site_pair_set Usage : $sitepairset->add_site_pair_set($site_pair_set_object) $sitepairset->add_site_pair(@list_of_site_pair_set_objects) Function: adds the contents of other TFBS::SitePairSet objects to an existing TFBS::SitePairSet object Returns : $sitepairset object (usually ignored) Args : A list of TFBS::SitePairSet objects whose contents should be added to $sitepairset Iterator Title : Iterator Usage : my $it = $sitepairset->Iterator(-sort_by=>'start'); while (my $site_pair = $it->next()) { #... Function: Returns an iterator object, used to iterate thorugh elements (TFBS::SitePair objects) Returns : a TFBS::_Iterator object Args : -sort_by # optional - currently it accepts # (default sort order in parenthetse) # 'name' (pattern name, alphabetically) # 'ID' (pattern/matrix ID, alphabetically) # 'start' (site start in sequence, # numerically,increasing order) # 'end' (site end in sequence, # numerically, increasing order) # 'score' (1st site in pair, # numerically, decreasing order) -reverse # optional - reverses the default sorting order if true set1 set2 Title : set1 set2 Usage : my $siteset1 = $sitepairset->set1(); : my $siteset2 = $sitepairset->set2() Function: Returns individual TFBS::SiteSet objects, from the site set pair Returns : A TFBS::SiteSet object Args : none GFF Title : GFF Usage : print $site->GFF(); : print $site->GFF($gff_formatter) Function: returns a "standard" multiline GFF string Returns : a string (multiline, newline terminated) Args : a $gff_formatter function reference (optional) perl v5.14.2 2008-01-24 TFBS::SitePairSet(3pm)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy