Sponsored Content
Top Forums UNIX for Advanced & Expert Users Sort on basis of particular field Post 302438169 by manishma71 on Monday 19th of July 2010 03:53:18 AM
Old 07-19-2010
I want a command which will sort on the basis of value between . and :

The solution provided might have issues if there are more dots in the input line after the : which makes this solution prone to error
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sort - only one field appears in output?

I'm running against a file with 1008 records like this, all beginning '4760 Slave': 4760 Slave,7,3607 ,GL ,200605,11320024 , ,GBP ,X00033 ,AI80190 ... (1 Reply)
Discussion started by: miwinter
1 Replies

2. Shell Programming and Scripting

sort columns by field

hello, i have a table contain many columns delimited by blank. i want to sort this table by the 2 columns and 3 one and i want to keep the first line inchanged? how can i do using the sort command? thanks table like : field1 field2 field3 field4 x y z b t h r n .. (4 Replies)
Discussion started by: kamel.seg
4 Replies

3. Shell Programming and Scripting

How to Sort files on date field

:cool: Hi all, I have a pecular issue in sorting these files in Solaris environment. All the below files are modified on November 4th, but I want to sort these files as per date column (eg: 01May07_1623 = ddmmmyy_hhmm) Nov 4 18:27 SONYELEC00.GI22973.01May07_1623.gpg Nov 4 18:27... (4 Replies)
Discussion started by: shivaastrogun
4 Replies

4. Shell Programming and Scripting

Sort alpha on 1st field, numerical on 2nd field (sci notation)

I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this: abc ||| 5e-05 ||| bla abc ||| 3 ||| ble def ||| 1 ||| abc def ||| 0.2 ||| def As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
Discussion started by: FrancoisCN
1 Replies

5. Shell Programming and Scripting

Sort two columns in a field, one of them being a date

Hi, I have a set of columns in a csv file, my first row being an integer and 2nd being a date. I want to first sort it using the first column and then by the second. for e.g. i have , 1234,09/05/2009,hi 5678,01/01/2008,hi 1234,11/03/2006,hello 5678,28/07/2010,hello i tried this... (5 Replies)
Discussion started by: sweta_doshi
5 Replies

6. Shell Programming and Scripting

Replace field when only "-" occurs on a random basis

I have a file in which "-"(by itself and nothing else) occurs in different fields in each record(sometimes in the 3 field, sometime in the 20th field, some time in the 100th field....etc). Also there are field of the format "abc-def". How do I replace fields that have just "-" with number zero. sed... (4 Replies)
Discussion started by: akshaykr2
4 Replies

7. Shell Programming and Scripting

Comparing two huge files on field basis.

Hi all, I have two large files and i want a field by field comparison for each record in it. All fields are tab seperated. file1: Email SELVAKUMAR RAMACHANDRAN Email SHILPA SAHU Web NIYATI SONI Web NIYATI SONI Email VIINII DOSHI Web RAJNISH KUMAR Web ... (4 Replies)
Discussion started by: Suman Singh
4 Replies

8. Shell Programming and Scripting

Sort help on non numeric field

Hi, I am unable to sort data on the first field $cat t Jim,212121,Seattle Bill,404404,Seattle Steve,246810,Nevada Scott,212277,LosAngeles Jim,212121,Ohio sort -t"," -k1,2 t Bill,404404,Seattle Jim,212121,Ohio Jim,212121,Seattle Scott,212277,LosAngeles Steve,246810,Nevada (7 Replies)
Discussion started by: Shivdatta
7 Replies

9. Shell Programming and Scripting

Sort field and uniq

I have a flatfile A.txt 2012/12/04 14:06:07 |trees|Boards 2, 3|denver|mekong|mekong12 2012/12/04 17:07:22 |trees|Boards 2, 3|denver|mekong|mekong12 2012/12/04 17:13:27 |trees|Boards 2, 3|denver|mekong|mekong12 2012/12/04 14:07:39 |rain|Boards 1|tampa|merced|merced11 How do i sort and get... (3 Replies)
Discussion started by: sabercats
3 Replies

10. UNIX for Dummies Questions & Answers

Sort array elements from same field

Hi, input: line1|error_type_a@15 line1|error_type_c@10 line1|error_type_b@5 line2|error_type_f@3 line2|error_type_a@1 I would need to place all the second fields with common first field on the same line, BUT with sorted error position number: line1|error_type_b@5; error_type_c@10;... (5 Replies)
Discussion started by: beca123456
5 Replies
DSPRFS(l)								 )								 DSPRFS(l)

NAME
DSPRFS - improve the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite and packed, and provides error bounds and backward error estimates for the solution SYNOPSIS
SUBROUTINE DSPRFS( UPLO, N, NRHS, AP, AFP, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, IWORK, INFO ) CHARACTER UPLO INTEGER INFO, LDB, LDX, N, NRHS INTEGER IPIV( * ), IWORK( * ) DOUBLE PRECISION AFP( * ), AP( * ), B( LDB, * ), BERR( * ), FERR( * ), WORK( * ), X( LDX, * ) PURPOSE
DSPRFS improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite and packed, and provides error bounds and backward error estimates for the solution. ARGUMENTS
UPLO (input) CHARACTER*1 = 'U': Upper triangle of A is stored; = 'L': Lower triangle of A is stored. N (input) INTEGER The order of the matrix A. N >= 0. NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0. AP (input) DOUBLE PRECISION array, dimension (N*(N+1)/2) The upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows: if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j; if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n. AFP (input) DOUBLE PRECISION array, dimension (N*(N+1)/2) The factored form of the matrix A. AFP contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by DSPTRF, stored as a packed triangular matrix. IPIV (input) INTEGER array, dimension (N) Details of the interchanges and the block structure of D as determined by DSPTRF. B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) The right hand side matrix B. LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N). X (input/output) DOUBLE PRECISION array, dimension (LDX,NRHS) On entry, the solution matrix X, as computed by DSPTRS. On exit, the improved solution matrix X. LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N). FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error. BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution). WORK (workspace) DOUBLE PRECISION array, dimension (3*N) IWORK (workspace) INTEGER array, dimension (N) INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value PARAMETERS
ITMAX is the maximum number of steps of iterative refinement. LAPACK version 3.0 15 June 2000 DSPRFS(l)
All times are GMT -4. The time now is 01:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy