Sponsored Content
Top Forums Shell Programming and Scripting How to sort the files according to the number? Post 302769866 by Chubler_XL on Wednesday 13th of February 2013 05:22:21 PM
Old 02-13-2013
try:

Code:
for i in `ls or*.dat | sort -k1.3n`;do

Some sorts allow a --debug option which is good to see what they are sorting on.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Why doesn't sort -k $number work ??

I know this seems like a stupid question. I am trying to sort an address book. Some peole have first, middle and last names, some only have first and last names. Eg: Bob Hope John Bon Jovi etc .. I want to sort this by last name. I was thinking of using something like sort -k $variable... (5 Replies)
Discussion started by: kevin80
5 Replies

2. Linux

How to sort the number of occurrences

file:///C:/Users/TSHEPI%7E1.LEB/AppData/Local/Temp/moz-screenshot.pngATM@ubuntu:~$ cat numbers2 | sort -n | uniq -c 1 7 1 11 2 10 3 the 1st numbers are the counts from the command "uniq -c", which represent the number of occurrences of each in the file. The "sort -n"... (4 Replies)
Discussion started by: lebogot
4 Replies

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

4. Shell Programming and Scripting

How can I sort by n number is like words?

I want to sort a file with a list of words, in order of most occuring words to least occurring words as well as alphabetically. ex: file1: cat 3 cat 7 cat 1 dog 3 dog 5 dog 9 dog 1 ape 4 ape 2 I want the outcome to be: file1.sorted: dog 1 (12 Replies)
Discussion started by: castrojc
12 Replies

5. Shell Programming and Scripting

How to count number of files in directory and write to new file with number of files and their name?

Hi! I just want to count number of files in a directory, and write to new text file, with number of files and their name output should look like this,, assume that below one is a new file created by script Number of files in directory = 25 1. a.txt 2. abc.txt 3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies

6. Shell Programming and Scripting

Help with sort word followed by exponential number and numeric number at the same time

Input file: ID_34 2E-69 2324 ID_1 0E0 3254 ID_1 0E0 5434 ID_5 0E0 436 ID_1 1E-14 2524 ID_1 5E-52 46437 ID_3 65E-20 45467 ID_1 0E0 6578 ... Desired output file: ID_1 0E0 6578 ID_1 0E0 5434 ID_1 0E0 3254 ID_1 5E-52 46437 ID_1 1E-14 2524 ID_3 65E-20 45467 (5 Replies)
Discussion started by: cpp_beginner
5 Replies

7. UNIX for Dummies Questions & Answers

Sort Files based on the number(s) on the file name

Experts I have a list of files in the directory mysample1 mysample2 mysample3 mysample4 mysample5 mysample6 mysample7 mysample8 mysample9 mysample10 mysample11 mysample12 mysample13 mysample14 mysample15 (4 Replies)
Discussion started by: dsedi
4 Replies

8. Shell Programming and Scripting

Sort Decimal number in UNIX

Hello Everyone, In one of my script, I would like to sort the decimal numbers. For e.g. If I have numbers like 1.0 1.1 1.2 2.0 2.1 3.0 4.0 5.0 6.0 7.0 7.1 7.10 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 I would like to sort them 1.0 1.1 1.2 2.0 2.1 3.0 4.0 5.0 6.0 7.0 7.1 7.2 7.3 7.4... (3 Replies)
Discussion started by: sachinrastogi
3 Replies

9. UNIX for Dummies Questions & Answers

Sort by alpha then by number

I have a file like the following: /vol/release /vol/listing /vol/trees7 /vol/toperforce /vol/trees10 /vol/trees2 /vol/wtrain I have tried the following: cat file | sort -t/ -dfk3.1 -t/ -k3.6n That did not work. What I want to do is have the file sorted so that the first... (2 Replies)
Discussion started by: newbie2010
2 Replies

10. Shell Programming and Scripting

Sort from highest to lowest number

Hi Guys, I am looking for a way to sort the output below from the "Inuse" count from Highest to Lowest. Is it possible? Thanks in advance. user1 0.12 0.06 0 0.12 User Inuse Pin Pgsp Virtual Unit:... (4 Replies)
Discussion started by: jaapar
4 Replies
mclblastline(1) 						  USER COMMANDS 						   mclblastline(1)

  NAME
      mclblastline - a pipeline for clustering from BLAST files.

  SYNOPSIS
      mclblastline file-name

      mclblastline [deblast options] [pipeline options] file-name

      NOTE
      mcl  has acquired the ability to proceed from label input as produced by mcxdeblast. This enables a very lightweight mechanism of generating
      clusterings from BLAST files.  You might want to use this mechanism, documented in the mcl manual.

      NOTE
      mclblastline used to require (given default parameters) the presence of the zoem macro processor to produce detailed  output.   This  is	no
      longer the case. By default mclblastline now creates a line-based tab-separated dump file.  Zoem will be invoked when the --fmt-fancy option
      is supplied.  In that case, zoem obviously has to be installed.

  DESCRIPTION
      mclblastline wraps around mclpipeline. It supplies the --parser=app and --parser-tag=str options, setting them  respectively  to	mcxdeblast
      and  blast.  This  tells	mclpipeline  to use mcxdeblast as the parse script in its pipeline.  The significance of the blast tag is that any
      mcxdeblast option can be passed through mclblastline and mclpipeline by inserting this tag into the option.  For example, mcxdeblast accepts
      the  --score=x option.  When using mclblastline, you specify it as --blast-score=x.  There are two exceptions to this rule, namely the --xi-
      dat=str and --xo-dat=str options. Refer to the mclpipeline manual for more information.

      Additionally, all mclpipeline options are acceptable to mcxdeblast as well. The --whatif is useful for getting a feel for the pipeline.  The
      --mcl-I=f  inflation  option  and --mcl-scheme=i scheme index options are your basic means for respectively manipulating cluster granularity
      and allocating resources. Read the mcl manual entries for a description of the corresponding -I and -scheme mcl options.

      The best advice is to glance over the mcxdeblast and mclpipeline options in order to get a feeling for which of those may come in handy  for
      you. Then start experimenting. Use the --whatif option, it will tell you what would happen without actually doing it.

  OPTIONS
      All mcxdeblast and mclpipeline options.  mcxdeblast options must be passed using the mechanism described above.

  EXAMPLES
	 mclblastline --blast-score=b
	    --blast-sort=a --blast-bcut=5 --mcl-I=2.5 myblastfile

      This  will use bit scores, sort cluster indices such that the corresponding labels are ordered alphabetically, ignore bit scores not exceed-
      ing 5, and use inflation value 2.5. In this case, the output clustering will be in the file named  myblastfile.I25s2  (I25  identifying  the
      inflation value and s2 identifying the resource scheme) and the formatted output will be in the file myblastfile.I25s2.fmt.

	 mclblastline --prepare-mcl myblastfile
	 mclblastline --start-mcl --mcl-I=1.2 myblastfile
	 mclblastline --start-mcl --mcl-I=1.6 myblastfile
	 mclblastline --start-mcl --mcl-I=2.0 myblastfile
	 mclblastline --start-mcl --mcl-I=2.4 myblastfile
	 mclblastline --start-mcl --mcl-I=2.8 myblastfile
	 etc ..

      The  first  run  prepares  an input matrix to be read by mcl.  In this case its file will be named myblastfile.sym.  The subsequent runs use
      this matrix.  CAVEAT there are some options that you need to repeat when executing such a resumed  run.  They  are  clearly  marked  in  the
      mclpipeline manual - namely those options that affect names of (intermediate) files. Most importantly, this concerns the mclpipeline options
      that have prefix --xo or --xi. For example,

	 mclblastline --prepare-mcl --blast-score=b --xo-dat=b myblastfile
	 mclblastline --start-mcl --xo-dat=b --mcl-I=1.2 myblastfile
	 mclblastline --start-mcl --xo-dat=b --mcl-I=1.6 myblastfile
	 mclblastline --start-mcl --xo-dat=b --mcl-I=2.0 myblastfile
	 mclblastline --start-mcl --xo-dat=b --mcl-I=2.4 myblastfile
	 mclblastline --start-mcl --xo-dat=b --mcl-I=2.8 myblastfile
	 etc ..

      In this case, the matrix file will be named myblastfile.b.sym, and the --xo-dat options must be repeated in all runs so  that  the  pipeline
      reconstructs the correct file name(s).

  AUTHOR
      Stijn van Dongen

  SEE ALSO
      mcxdeblast, mclpipeline, mcxassemble.

  mclblastline 12-068						      8 Mar 2012						     mclblastline(1)
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy