Sponsored Content
Top Forums UNIX for Beginners Questions & Answers awk replace cells with NaN/delete if condition Post 303019109 by RudiC on Saturday 23rd of June 2018 03:27:45 AM
Old 06-23-2018
Quote:
Originally Posted by geomarine
Thanks RudiC, I could just remove the fields with values above -2000, but I want to remain the structure such that I have a 4x4 matrix. then perform calculations only on the remaining values.
I made several attempts to operate only on $3, but couldn't so I decided to try another way, since $1 and $2 can't be affected by the condition (>-2000).

---------- Post updated at 03:35 PM ---------- Previous update was at 03:32 PM ----------

I also considered print $3, so I can apply the condition to it separately, but the whole fields are deleted and could not fit the 4x4 structure I intend to retain.

Help me out - what 4x4- matrix are you talking of? I see a 3 fields file n lines long. If you need to convert that to another matrix, post the rules / logics to be applied and people in here might be able to help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparison of Cells in EXCEL using awk

Hi I have 2 csv files which looks like the following and i have to compare the 2 CSVs and create a third file such that if the value of the 1st cell in A.CSV and the value of the first cell in the B.CSV are same, it should print "SAME" in the third file or else print NOT SAME. Likewise i need... (19 Replies)
Discussion started by: meva
19 Replies

2. Shell Programming and Scripting

Delete line with sed or awk (with specified condition)

Hello. I'm trying to delete the lines of a file does not contain the letter "T " (for example) at position 26. So far, I could only print the result: awk '{if (substr ($ 1,1,26)! ~ / T /) print}' file.txt How I can do to eliminate the lines that meet this condition? Help please. ... (4 Replies)
Discussion started by: </kida>
4 Replies

3. UNIX for Dummies Questions & Answers

How do you delete cells from a space delimited text file given row and column number?

How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Delete files with condition

I have a directory containing thousands of items “video files”, these items were generated by an application, which generates two items with the same name but with different extensions “.avi and .mp4”. There was a tool in my application to remove one item @ a time. Later I found this tool removes... (5 Replies)
Discussion started by: awadeid
5 Replies

5. Shell Programming and Scripting

Delete records within a file upon a condition

Hi Friends, I have the following file, cat input chr1 1000 2000 chr1 600 699 chr1 701 1000 chr1 600 1710 chr2 900 1800 Now, I would like to see the difference of Record1.Col2 - Record2.Col2 Record1.Col2 - Record2.Col3 Record1.Col3 - Record2.Col2 Record1.Col3 - Record2.Col3 ... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

6. Shell Programming and Scripting

Delete if condition met in a column

i have a table like this: id, senderNumber, blacklist ----------------------------- 1 0835636326 Y 2 0373562343 Y 3 0273646833 Y and I want to delete automatically if a new inserted row on another table consist anything on senderNumber column above using a BASH Script I... (9 Replies)
Discussion started by: jazzyzha
9 Replies

7. UNIX for Dummies Questions & Answers

Replace with condition

I have file input a,b,b,b,ee,b3012dasda,53012,203,1,END,START b,c,b,b,ee,sdasdad,57483,203,,END,START a,b,b,b,ee,b3012dasda,53012,203,,END,START b,c,b,b,ee,sdasdad,57483,203,1,END,START I want every ",," in $9 replace with ,0, the output should be ... (3 Replies)
Discussion started by: radius
3 Replies

8. Shell Programming and Scripting

Delete File in a Directory Using a Condition

Hello, I have a directory with many files whose creation time is distributed all over the day. I need ANY 20 files per hour. So, I need 20 files for hour 00 20 files for hour 01 ... 20 files for hour 23 What I have done so far is not great. Here is the code: # get the Month a=`echo... (8 Replies)
Discussion started by: shekhar2010us
8 Replies

9. Shell Programming and Scripting

Delete complete row according to condition

Gents, Please can you help me. In the range 4-24 column the values are duplicate some times and I will like to delete the fist occurrence and keep the last only. The file is not sorted and I can sorted because from column 75 to the end the file is increase by time.. I have a file like this... (10 Replies)
Discussion started by: jiam912
10 Replies

10. Shell Programming and Scripting

awk to replace a specific field in certain condition

Hi, I have a file like below PRUM,67016800 ,CC ,C1,67016800 , ,Y,Y,2 ,CK,BX,FOX ,00000001,EA,00000001,20141120 00:00:00, ,N,Y,Y,CK ABCDEF... (7 Replies)
Discussion started by: mady135
7 Replies
GLMULTMATRIX(3G)														  GLMULTMATRIX(3G)

NAME
glMultMatrixd, glMultMatrixf - multiply the current matrix with the specified matrix C SPECIFICATION
void glMultMatrixd( const GLdouble *m ) void glMultMatrixf( const GLfloat *m ) PARAMETERS
m Points to 16 consecutive values that are used as the elements of a 4x4 column-major matrix. DESCRIPTION
glMultMatrix multiplies the current matrix with the one specified using m, and replaces the current matrix with the product. The current matrix is determined by the current matrix mode (see glMatrixMode). It is either the projection matrix, modelview matrix, or the texture matrix. EXAMPLES
If the current matrix is C, and the coordinates to be transformed are, v=(v[0],v[1],v[2],v[3]). Then the current transformation is Cxv, or c[0] c[4] c[8] c[12] v[0] (c[1] c[5] c[9] c[13])x(v[1]) c[2] c[6] c[10] c[14] v[2] c[3] c[7] c[11] c[15] v[3] Calling glMultMatrix with an argument of m=m[0],m[1],...,m[15] replaces the current transformation with (CxM)xv, or c[0] c[4] c[8] c[12] m[0] m[4] m[8] m[12] v[0] (c[1] c[5] c[9] c[13])x(m[1] m[5] m[9] m[13])x(v[1]) c[2] c[6] c[10] c[14] m[2] m[6] m[10] m[14] v[2] c[3] c[7] c[11] c[15] m[3] m[7] m[11] m[15] v[3] Where 'x' denotes matrix multiplication, and v is represented as a 4x1 matrix. NOTES
While the elements of the matrix may be specified with single or double precision, the GL may store or operate on these values in less than single precision. In many computer languages 4x4 arrays are represented in row-major order. The transformations just described represent these matrices in column-major order. The order of the multiplication is important. For example, if the current transformation is a rotation, and glMultMatrix is called with a translation matrix, the translation is done directly on the coordinates to be transformed, while the rotation is done on the results of that translation. ERRORS
GL_INVALID_OPERATION is generated if glMultMatrix is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glGet with argument GL_MATRIX_MODE glGet with argument GL_COLOR_MATRIX glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX SEE ALSO
glLoadIdentity(3G), glLoadMatrix(3G), glMatrixMode(3G), glPushMatrix(3G) GLMULTMATRIX(3G)
All times are GMT -4. The time now is 07:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy