Sponsored Content
Full Discussion: Add values < or eq to 1000
Top Forums Shell Programming and Scripting Add values < or eq to 1000 Post 302369872 by repinementer on Monday 9th of November 2009 10:06:53 PM
Old 11-09-2009
Add values < or eq to 1000

make a list based on the first column key and corresponding value (2nd column-bold) in input1 search values that less than or equal to 1000 (2nd column-bold)in the input2 of the same key along with other columns.


input
Code:
x1 10 hfffhf 646474_jhg
x2 100 jkfgjj 765755_jg

input2
Code:
x1 -990 jgjgjggjhgh
x1 -991 jgjhgjgg
x1 1010 nbnmmbmb
x1 1011 jhgjhg
x2 1100 ghjgjhg
x2 1111 jbhgjg
x2 -900 jghgh
x2 -899 97jjkh

output
Code:
x1 10 hfffhf 646474_jhg x1 -990 jgjgjggjhgh
x1 10 hfffhf 646474_jhg x1 1010 nbnmmbmb
x2 100 jkfgjj 765755_jg x2 1100 ghjgjhg
x2 100 jkfgjj 765755_jg x2 -900 jghgh

Thanx
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to add two large values

Hi, Gives me wrong value when, $ echo `expr 2221753117 + 299363384` -1773850795 How to overcome this? Appreciate any help on this. -Om (5 Replies)
Discussion started by: Omkumar
5 Replies

2. Shell Programming and Scripting

Help: How do I ADD non-integer (decimal) values?

I am trying to create a script that will read from a file two non-integer values (decimals) and add those values together. For example, I want to add 1.51 and -2.37 together and get the sum. Any ideas? Thanks! (2 Replies)
Discussion started by: limshady411
2 Replies

3. Shell Programming and Scripting

Command to add 1000 spaces to end of line

hi, could anyone tell me the command to append spaces at the end of the line. for example, i need 1000 spaces after the word "helloworld" echo "helloworld " i need to achieve this in someother way hardcoding 1000 spaces is not practical. as i am totally new... (3 Replies)
Discussion started by: kavithacs
3 Replies

4. Shell Programming and Scripting

Add headerline to the values

if header line starts with chr1 and span 10 print chr1 and the original values and ov+10 and viceversa input variableStep chrom=chr1 span=10 191 1 201 18 211 1 variableStep chrom=chr2 span=10 191 11 201 1 211 12 output chr1 191 201 1 chr1 201 211 ... (4 Replies)
Discussion started by: quincyjones
4 Replies

5. Shell Programming and Scripting

unique entry add values

Hi, I have a file with 3 columns ABC 3 1 ABC 5 1 XYZ 4 2 DEF 3 2 DEF 4 1 DEF 6 1 MNO 5 5 JKL 3 2 JKL 4 2 PQR 12 1 For each unique entry in column 1 I want to add values in column 2 and column3 o/p ABC 8 2 XYZ 4 2 (1 Reply)
Discussion started by: Diya123
1 Replies

6. Shell Programming and Scripting

Add values in 2 columns and subtract from third

Hi All, I have a file with thousands of lines in the following format, where Field1=First 8 characters Field2-9-16 characters Field3=17-26 characters I need to add Field 1 and Field2 and subtract the result from Field 3. Field3=Field3 - (Field1 + Field2) 0012.00 0010.00 0001576.53... (4 Replies)
Discussion started by: nua7
4 Replies

7. Shell Programming and Scripting

Add 0 values to replace empty value

Hi Guys. Please can you help me to add 0 values. Starting in column 121 Imput file A 4175.0 8055.01211 75 1 -2172671 77 45 16 457626.4 2609265.1 131.3 1090 102 1 1T N/A124 15 0.8 1051670971100000 A 4175.0 8055.012 7 75 2 -5204072 78 43 25... (10 Replies)
Discussion started by: jiam912
10 Replies

8. Programming

How to add one to each row values and keep it after the value in the column?

Dear Folks Hello I have a column of numbers, say: 26 79 68 I want to add one to each row value and get this desire column: 26 27 79 80 68 69 (6 Replies)
Discussion started by: sajmar
6 Replies

9. Shell Programming and Scripting

Add the values of the lines according to a condition

hi everybody :) I am a beginner in bash and I want to convert the result I have here I want it to be grouped by IP address so iwanna get for each ip adsress the addition of all bandwidth where ip is 100.1.1.15 in other words for 100.1.1.15 it groups me all the values whose ip address is... (11 Replies)
Discussion started by: aynar
11 Replies

10. UNIX for Beginners Questions & Answers

Add values to file in 2 new columns

Columns 4 and 5 are X and Y coordinates, column 6 is the elevation I would like to add 2 new columns at the end of the file with values the distance between first(X)(Y) and last location (X)(Y), based in 2 rows the difference in elevation = ($6-prev6) How to calculate the requested values... (6 Replies)
Discussion started by: jiam912
6 Replies
PSIGNAL(9)						   BSD Kernel Developer's Manual						PSIGNAL(9)

NAME
psignal, pgsignal, gsignal, tdsignal -- post signal to a thread, process, or process group SYNOPSIS
#include <sys/types.h> #include <sys/signalvar.h> void psignal(struct proc *p, int signum); void pgsignal(struct pgrp *pgrp, int signum, int checkctty); void gsignal(int pgid, int signum); void tdsignal(struct thread *td, int signum); DESCRIPTION
These functions post a signal to a thread or one or more processes. The argument signum common to all three functions should be in the range [1-NSIG]. The psignal() function posts signal number signum to the process represented by the process structure p. With a few exceptions noted below, the target process signal disposition is updated and is marked as runnable, so further handling of the signal is done in the context of the target process after a context switch. Note that psignal() does not by itself cause a context switch to happen. The target process is not marked as runnable in the following cases: o The target process is sleeping uninterruptibly. The signal will be noticed when the process returns from the system call or trap. o The target process is currently ignoring the signal. o If a stop signal is sent to a sleeping process that takes the default action (see sigaction(2)), the process is stopped without awakening it. o SIGCONT restarts a stopped process (or puts them back to sleep) regardless of the signal action (e.g., blocked or ignored). If the target process is being traced psignal() behaves as if the target process were taking the default action for signum. This allows the tracing process to be notified of the signal. The pgsignal() function posts signal number signum to each member of the process group described by pgrp. If checkctty is non-zero, the sig- nal will be posted only to processes that have a controlling terminal. pgsignal() is implemented by walking along the process list headed by the field pg_members of the process group structure pointed at by pgrp and calling psignal() as appropriate. If pgrp is NULL no action is taken. The gsignal() function posts signal number signum to each member of the process group identified by the group id pgid. gsignal() first finds the group structure associated with pgid, then invokes pgsignal() with the argument checkctty set to zero. If pgid is zero no action is taken. The tdsignal() function posts signal number signum to the thread represented by the thread structure td. SEE ALSO
sigaction(2), signal(9), tsleep(9) BSD
October 8, 2011 BSD
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy