Sponsored Content
Top Forums Shell Programming and Scripting Grep/awk part of info of a column Post 302878436 by owwow14 on Friday 6th of December 2013 06:33:34 AM
Old 12-06-2013
Grep/awk part of info of a column

I have a question that I am at a loss to solve. I have 3 column tab-separated data, such as:

Code:
abs nmod+n+n-commitment-n   349.200023 
abs nmod+n+n-a-commitment-n 333.306429 
abs into+ns-j+vn-pass-rb-divide-v   295.57316 
abs nmod+n+ns-commitment-n  182.085018 
abs nmod+n+n-pledge-n   149.927391
abs nmod+n+ns-reagent-n 142.347358

I need to isolate the last two "elements" of the third column, in which my desired result would be a 4-column output that only contains those elements that end with "-n".
such as:
Code:
abs nmod+n+n   commitment-n   349.200023
abs nmod+n+n-a   commitment-n 333.306429 
abs nmod+n+ns   commitment-n  182.085018 
abs nmod+n+n   pledge-n   149.927391
 abs nmod+n+ns   reagent-n 142.347358

.

In this case, is there an awk, grep anything that can help? The files are approx. 500 MB, so they are not huge, but not small either. Thanks for any insight.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pull info under headers in file(awk,grep,while loop)

below is an extract from my file and I am trying to use Awk and grep and a while loop to pull infomation from under neath "HBA WWN=".HBA WWN=" reoccurs all over the file but the 100000c.....number are unique and I want to be able to pull and reference specifi information under this header ever time... (2 Replies)
Discussion started by: kieranfoley
2 Replies

2. Shell Programming and Scripting

Changing part of column value with AWK

Hi All , Here is my req I am extracting a column value and I want to change part of its value according to user input Say the column I extracted is of 15 digits and I want to change the 11th to 14th position with user input 4 digit value Example column value 111111111111111 user input... (8 Replies)
Discussion started by: Pratik4891
8 Replies

3. Shell Programming and Scripting

grep/awk on a single column in a for loop

Hi I'm trying to loop through a small list of id's and then pull out a few columns if the id matches that found in column 2 of the larger file. I managed to get one command to work awk -F " " '{if ($2 == '154080196') print $2,$3,$4}' tst.txt | less However, when I try it in a for loop I... (3 Replies)
Discussion started by: flotsam
3 Replies

4. Shell Programming and Scripting

grep/awk column or variable?

Hi, I'm running via PuTTY, in a BASH shell to do my work. I'm running calculations where steps are reported like this every 100 steps: NSTEP = 249900 TIME(PS) = 249.900 TEMP(K) = 299.94 PRESS = 21.1 Etot = -12912.5557 EKtot = 4996.8780 EPtot = -17909.4336 ... (6 Replies)
Discussion started by: Oriksagtaria
6 Replies

5. Shell Programming and Scripting

Awk: Need help replacing a specific column in a file by part of a column in another file

Hi, I have two input files as File1 : ABC:client1:project1 XYZ:client2-aa:project2 DEF:client4:proj File2 : client1:W-170:xx client2-aa:WT-04:yy client4:L-005A:zz Also, array of valid values can be hardcoded like Output : ABC:W:project1 XYZ:WT:project2 (1 Reply)
Discussion started by: aa2601
1 Replies

6. Shell Programming and Scripting

awk to replace part of a column

dear all, I'm trying to use Awk to eliminate the last two characters from the first column in a file. This two characters are "-1" and I need to eliminate them from each row that I have in the files. The files have two columns and look like: ID_090-1 2 ID_3787-1 4 ID_0098-1 1 ID_12-1 4 I... (4 Replies)
Discussion started by: gabrysfe
4 Replies

7. Shell Programming and Scripting

[awk] grep a part of filename as entry file

hi all, i need to combine these files into one csv file. Bounce_Mail_Event_Daily_Report_01_Jul_2012.csv Bounce_Mail_Event_Daily_Report_02_Jul_2012.csv Bounce_Mail_Event_Daily_Report_03_Jul_2012.csv Bounce_Mail_Event_Daily_Report_04_Jul_2012.csv... (10 Replies)
Discussion started by: makan
10 Replies

8. Shell Programming and Scripting

awk or grep to search one column and output the other

Hello, it would be great if someone can help me with the following: I want to search for the rows from fileA in column 1 of fileB and output column 2 of fileB if found in fileC. In the moment I search within the complete file. How can I change the code so only column 1 is searched? cat fileA... (7 Replies)
Discussion started by: Manyaka
7 Replies

9. Shell Programming and Scripting

Use grep/awk to remove part of column

hi all, how can i use grep or awk to clean the following input data: n<>the<>96427210 861521305 123257583 n<>obj<>79634223 861521305 79634223 n<>nmod<>68404733 861521305 68422718 where the desired results is to remove all non-numeric characters?: 96427210 861521305 123257583 ... (5 Replies)
Discussion started by: owwow14
5 Replies

10. Shell Programming and Scripting

How to awk or grep the last column in file when date on column contains spaces?

Hi have a large spreadsheet which has 4 columns APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96034 Storage Mgmt Team APM00111803814 server_2 96152 GWP... (6 Replies)
Discussion started by: kieranfoley
6 Replies
cla_geamv.f(3)							      LAPACK							    cla_geamv.f(3)

NAME
cla_geamv.f - SYNOPSIS
Functions/Subroutines subroutine cla_geamv (TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY) CLA_GEAMV Function/Subroutine Documentation subroutine cla_geamv (integerTRANS, integerM, integerN, realALPHA, complex, dimension( lda, * )A, integerLDA, complex, dimension( * )X, integerINCX, realBETA, real, dimension( * )Y, integerINCY) CLA_GEAMV Purpose: CLA_GEAMV performs one of the matrix-vector operations y := alpha*abs(A)*abs(x) + beta*abs(y), or y := alpha*abs(A)**T*abs(x) + beta*abs(y), where alpha and beta are scalars, x and y are vectors and A is an m by n matrix. This function is primarily used in calculating error bounds. To protect against underflow during evaluation, components in the resulting vector are perturbed away from zero by (N+1) times the underflow threshold. To prevent unnecessarily large errors for block-structure embedded in general matrices, "symbolically" zero components are not perturbed. A zero entry is considered "symbolic" if all multiplications involved in computing that entry have at least one zero multiplicand. Parameters: TRANS TRANS is INTEGER On entry, TRANS specifies the operation to be performed as follows: BLAS_NO_TRANS y := alpha*abs(A)*abs(x) + beta*abs(y) BLAS_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y) BLAS_CONJ_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y) Unchanged on exit. M M is INTEGER On entry, M specifies the number of rows of the matrix A. M must be at least zero. Unchanged on exit. N N is INTEGER On entry, N specifies the number of columns of the matrix A. N must be at least zero. Unchanged on exit. ALPHA ALPHA is REAL On entry, ALPHA specifies the scalar alpha. Unchanged on exit. A A is COMPLEX array, dimension (LDA,n) Before entry, the leading m by n part of the array A must contain the matrix of coefficients. Unchanged on exit. LDA LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, m ). Unchanged on exit. X X is COMPLEX array, dimension ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. Before entry, the incremented array X must contain the vector x. Unchanged on exit. INCX INCX is INTEGER On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit. BETA BETA is REAL On entry, BETA specifies the scalar beta. When BETA is supplied as zero then Y need not be set on input. Unchanged on exit. Y Y is REAL array, dimension ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. Before entry with BETA non-zero, the incremented array Y must contain the vector y. On exit, Y is overwritten by the updated vector y. INCY INCY is INTEGER On entry, INCY specifies the increment for the elements of Y. INCY must not be zero. Unchanged on exit. Level 2 Blas routine. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Definition at line 175 of file cla_geamv.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 cla_geamv.f(3)
All times are GMT -4. The time now is 12:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy