Sponsored Content
Top Forums Shell Programming and Scripting Sed or Grep to delete line containing patter plus extra line Post 302433637 by rocketman88 on Wednesday 30th of June 2010 06:59:03 AM
Old 06-30-2010
Thanks

Works well, thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed: delete regex line and next line if blank

Hi, I want to write a sed script which from batiato: batiato/giubbe: pip_b.2.txt pip_b.3.txt pip_b.3mmm.txt bennato: bennato/peterpan: 123.txt consoli: pip_a.12.txt daniele: (2 Replies)
Discussion started by: one71
2 Replies

2. UNIX for Advanced & Expert Users

Inserting a line before the line which matches the patter

Hi Is there any command where we can insert a line "2|||" before every line starting with "3|" my input is as follows 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 2|EN_GB||Electrogalvanize 0.5 m2 ( Renault ) 1|ETG|12345 3|88.51|||GBP|| desired output... (10 Replies)
Discussion started by: laxmi131
10 Replies

3. Shell Programming and Scripting

Grep a string in a range and delete the line

Hi, i need to delete a lines after searching a particular string but this searching should only happen after the 4th line.. basically imagine a file like this From: abcd.yahoo.com To: cdeb.yahoo.com Subject: hi all sdfsd sadasd asdasd dfsdf From: abcd.yahoo.com To:... (3 Replies)
Discussion started by: depakjan
3 Replies

4. Shell Programming and Scripting

'sed' command shows extra line

Here is an interesting problem that I am seeing when using 'sed'. The goal is to print out the names of the Oracle SID's on a system and here is the command I am using: ps -ef|grep ora|grep pmon|awk '{print $NF}'|sed 's/ora_pmon_//' The output of the command after the awk is this: ... (3 Replies)
Discussion started by: soleil4716
3 Replies

5. Shell Programming and Scripting

USING sed to delete a line

Please let me know wat would be sed command to delete any partcular line from a file and also moving lines below it to up. ie wen line #9 is deleted data in line #10 should move to #9 and so on. (2 Replies)
Discussion started by: fidelis
2 Replies

6. Shell Programming and Scripting

how to delete extra character in a line?

And I want to delete the characters longer than 20 for each line start with #. The other lines should remain the same. I think this can be done by sed. Could anyone help me with this? Thanks! my input file: #ZP_05494889.1_Clostridium_papyrosolvens... (3 Replies)
Discussion started by: ritacc
3 Replies

7. Shell Programming and Scripting

Delete line breaks and extra spaces between patterns

Hi, if in between strings "<section" and "</section>" across multiple lines there occurs the string "ole-present", delete all line breaks and replace any tabs or multiple spaces with a single space. Looking for an AWK or SED solution. Thank you. <section ... status = "ole-present" ...... (2 Replies)
Discussion started by: pioavi
2 Replies

8. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

9. Shell Programming and Scripting

sed for appending a line before a pattern and after another patter.

Hi All, I'm appending a line before a pattern and after another pattern(;) but omitting the first pattern - same as if comes duplicates before the second pattern. Also, I'm adding a word before the first pattern - Here is my file select blah blah hello select blah blah ; select... (6 Replies)
Discussion started by: Mannu2525
6 Replies

10. Shell Programming and Scripting

Sed/grep: check if line exists, if not add line?

Hello, I'm trying to figure out how to speed up the following as I want to use multiple commands to search thousands of files. is there a way to speed things up? Example I want to search a bunch of files for a specific line, if this line already exists do nothing, if it doesn't exist add it... (4 Replies)
Discussion started by: f77hack
4 Replies
Math(3) 						User Contributed Perl Documentation						   Math(3)

NAME
PDL::Math - extended mathematical operations and special functions SYNOPSIS
use PDL::Math; use PDL::Graphics::TriD; imag3d [SURF2D,bessj0(rvals(zeroes(50,50))/2)]; DESCRIPTION
This module extends PDL with more advanced mathematical functions than provided by standard Perl. All the functions have one input pdl, and one output, unless otherwise stated. The functions are usually available from the system maths library, however if they are not (determined when PDL is compiled) a version from the Cephes math library is used. FUNCTIONS
acos Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. asin Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. atan Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. cosh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. sinh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. tan Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. tanh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. ceil Signature: (a(); [o]b()) Round to integral values in floating-point format. Works inplace. floor Signature: (a(); [o]b()) Round to integral values in floating-point format. Works inplace. rint Signature: (a(); [o]b()) Round to integral values in floating-point format. Works inplace. pow Signature: (a(); b(); [o]c()) Synonym for `**'. Works inplace. acosh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. asinh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. atanh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. erf Signature: (a(); [o]b()) The error function. Works inplace. erfc Signature: (a(); [o]b()) The complement of the error function. Works inplace. bessj0 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessj1 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessy0 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessy1 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessjn Signature: (a(); int n(); [o]b()) The standard Bessel function. This has a second integer argument which gives the order of the function required. Works inplace. bessyn Signature: (a(); int n(); [o]b()) The standard Bessel function. This has a second integer argument which gives the order of the function required. Works inplace. lgamma Signature: (a(); [o]b(); int[o]s()) log gamma function This returns 2 piddles -- the first set gives the log(gamma) values, while the second set, of integer values, gives the sign of the gamma function. This is useful for determining factorials, amongst other things. badmask Signature: (a(); b(); [o]c()) Clears all "infs" and "nans" in $a to the corresponding value in $b. badmask can be run with $a inplace: badmask($a->inplace,0); $a->inplace->badmask(0); isfinite Signature: (a(); int [o]mask()) Sets $mask true if $a is not a "NaN" or "inf" (either positive or negative). Works inplace. erfi Signature: (a(); [o]b()) The inverse of the error function. Works inplace. ndtri Signature: (a(); [o]b()) The value for which the area under the Gaussian probability density function (integrated from minus infinity) is equal to the argument (cf erfi). Works inplace. svd Signature: (a(n,m); [o]u(n,m); [o,phys]z(n); [o]v(n,n)) Singular value decomposition of array. ($u, $s, $v) = svd($a); polyroots Signature: (cr(n); ci(n); [o]rr(m); [o]ri(m)) Complex roots of a complex polynomial, given coefficients in order of decreasing powers. ($rr, $ri) = polyroots($cr, $ci); eigens Signature: ([phys]a(m); [o,phys]ev(n,n); [o,phys]e(n)) Eigenvalues and -vectors of a symmetric square matrix. If passed an asymmetric matrix, the routine will warn and symmetrize it. ($e, $ev) = eigens($a); simq Signature: ([phys]a(n,n); [phys]b(n); [o,phys]x(n); int [o,phys]ips(n); int flag) Solution of simultaneous linear equations, "a x = b". $a is an "n x n" matrix (i.e., a vector of length "n*n"), stored row-wise: that is, "a(i,j) = a[ij]", where "ij = i*n + j". While this is the transpose of the normal column-wise storage, this corresponds to normal PDL usage. The contents of matrix a may be altered (but may be required for subsequent calls with flag = -1). $b, $x, $ips are vectors of length "n". Set "flag=0" to solve. Set "flag=-1" to do a new back substitution for different $b vector using the same a matrix previously reduced when "flag=0" (the $ips vector generated in the previous solution is also required). squaretotri Signature: (a(n,n); b(m)) Convert a symmetric square matrix to triangular vector storage BUGS
Hasn't been tested on all platforms to ensure Cephes versions are picked up automatically and used correctly. AUTHOR
Copyright (C) R.J.R. Williams 1997 (rjrw@ast.leeds.ac.uk), Karl Glazebrook (kgb@aaoepp.aao.gov.au) and Tuomas J. Lukka (Tuomas.Lukka@hel- sinki.fi). All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. perl v5.8.0 2003-01-29 Math(3)
All times are GMT -4. The time now is 12:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy