Sponsored Content
Top Forums Shell Programming and Scripting How to print first matching range in awk? Post 302536160 by thearpit on Monday 4th of July 2011 08:59:23 AM
Old 07-04-2011
Hi Mirni,

thanks for your post. But after getting this, i need 2nd match. How i'll get that.?

thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print matching field using awk

Hi All, I have a string like below: str="Hold=True Map=False 'This will map the data' Run=Yes Modify=False" I want to print the field Run=Yes and retrive the value "Yes". I cannot use simple awk command because the position of the "Run" will be different at different times. Is there a way... (6 Replies)
Discussion started by: deepakgang
6 Replies

2. Shell Programming and Scripting

Print lines matching value(s) in other file using awk

Hi, I have two comma separated files. I would like to see field 1 value of File1 exact match in field 2 of File2. If the value matches, then it should print matched lines from File2. I have achieved the results using cut, paste and egrep -f but I would like to use awk as it is efficient way and... (7 Replies)
Discussion started by: SBC
7 Replies

3. Shell Programming and Scripting

How to Print from matching word to end using awk

Team, Could some one help me in Printing from matching word to end using awk For ex: Input: I am tester for now I am tester yesterday I am tester tomorrow O/p tester for now tester yesterday tester tomorrow i.e Starting from tester till end of sentence (5 Replies)
Discussion started by: mallak
5 Replies

4. Shell Programming and Scripting

AWK Script - Print a column - within a Row Range

Hi, Please read the whole thread. I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well. example: PACKET DATA PROTOCOL CONTEXT DATA APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID 10 ... (6 Replies)
Discussion started by: panapty
6 Replies

5. Shell Programming and Scripting

awk to print range of fields

Hi file.in and file.out are in csv format. the code I have now is, cat file.in | awk -F"," '!($1$2$3$4$5$6$7$8 in a){a;print $0}' > file.out Here, I am printing entire line using $0. however, I want to print $1 to $150 and it should be in csv format. Cut -d is not good in performace.... (3 Replies)
Discussion started by: krishnix
3 Replies

6. Shell Programming and Scripting

print range of lines matching pattern and previous line

Hi all, on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern. the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/' I need to include the... (1 Reply)
Discussion started by: siriche
1 Replies

7. Shell Programming and Scripting

How to print in awk matching $1 values ,to $1,$4 example given.?

Hi Experts, I am trying to get the output from a matching pattern but unable to construct the awk command: file : aa bb cc 11 dd aa cc 33 cc 22 45 68 aa 33 44 44 dd aa cc 37 aa 33 44 67 I want the output to be : ( if $1 match to "aa" start of the line,then print $4 of that line, and... (3 Replies)
Discussion started by: rveri
3 Replies

8. UNIX for Dummies Questions & Answers

How to print specific range using awk?

I want to print specific range of rows and then its columns using awk command. lets say if a file contain 15 line then i need to print line 5 to 9. awk '{print;for( NR>=5&&NR<=9); do; print "<tr>\n<td>"$1"</td><td>"$2"</td><td>"$3"</td>\n</tr" done}' xyz.csv not sure what's wrong... (9 Replies)
Discussion started by: amyt1234
9 Replies

9. Shell Programming and Scripting

awk to print out lines that do not fall between range in file

In the awk below I am trying to print out those lines in file2 that are no between $2 and $3 in file1. Both files are tab-delimeted and I think it's close but currently it is printeing out the matches. The --- are not part of the files they are just to show what lines match or fall into the range... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

awk to print text in field if match and range is met

In the awk below I am trying to match the value in $4 of file1 with the split value from $4 in file2. I store the value of $4 in file1 in A and the split value (using the _ for the split) in array. I then strore the value in $2 as min, the value in $3 as max, and the value in $1 as chr. If A is... (6 Replies)
Discussion started by: cmccabe
6 Replies
spline(1)							   User Commands							 spline(1)

NAME
       spline - interpolate smooth curve

SYNOPSIS
       spline [-aknpx] ...

DESCRIPTION
       spline takes pairs of numbers from the standard input as abcissas and ordinates of a function. It produces a similar set, which is approxi-
       mately equally spaced and includes the input set, on the standard output. The cubic spline output (R. W.  Hamming,  Numerical  Methods  for
       Scientists  and	Engineers,2nd  ed.,  349ff)  has two continuous derivatives, and sufficiently many points to look smooth when plotted, for
       example by graph(1).

OPTIONS
       -a	Supply abscissas automatically (they are missing from the input); spacing is given by the next argument, or is assumed to be 1	if
		next argument is not a number.

       -k	The constant k used in the boundary value computation

		(2nd deriv. at end) = k*(2nd deriv. next to end)

		is set by the next argument. By default k = 0.

       -n	Space output points so that approximately n intervals occur between the lower and upper x limits.  (Default n = 100.)

       -p	Make output periodic, that is, match derivatives at ends. First and last input values should normally agree.

       -x	Next  1  (or  2) arguments are lower (and upper) x limits.  Normally these limits are calculated from the data. Automatic abcissas
		start at lower limit (default 0).

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       +-----------------------------+-----------------------------+
       |      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
       +-----------------------------+-----------------------------+
       |Availability		     |SUNWesu			   |
       +-----------------------------+-----------------------------+

SEE ALSO
       graph(1), attributes(5)

       R. W. Hamming, Numerical Methods for Scientists and Engineers, 2nd ed.

DIAGNOSTICS
       When data is not strictly monotonic in x, spline reproduces the input without interpolating extra points.

BUGS
       A limit of 1000 input points is enforced silently.

SunOS 5.10							    14 Sep 1992 							 spline(1)
All times are GMT -4. The time now is 09:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy