Sponsored Content
Top Forums Shell Programming and Scripting Perl: Printing Multiple Lines after pattern match Post 302333366 by Deep9000 on Sunday 12th of July 2009 10:11:14 PM
Old 07-12-2009
Thanks, I really appreciate it.
There is one other thing. You have undef $\. Which is good if the file is small. But the files are going to grow and this is why I am trying to go line by line using the while loops. The only trouble is catching the next "n" lines before the start of other Query=
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenating multiple lines to one line if match pattern

Hi all, I've been working on a script which I have hit a road block now. I have written a script using sed to extract the below data and pumped into another file: Severity............: MAJORWARNING Summary: System temperature is out of normal range. Severity............: MAJORWARNING... (13 Replies)
Discussion started by: phixsius
13 Replies

2. Shell Programming and Scripting

read and match multiple lines in perl

Could any one tell me how to read and match multiple lines in perl? Did this code below still work in this situation? while (<FILE>) { if (/ /) { } } Thanks a lot! (5 Replies)
Discussion started by: zx1106
5 Replies

3. Shell Programming and Scripting

Perl script to match a pattern and print lines

Hi I have a file (say 'file1')and I want to search for a first occurence of pattern (say 'ERROR') and print ten lines in the file below pattern. I have to code it in PERL and I am using Solaris 5.9. I appreciate any help with code Thanks Ammu (6 Replies)
Discussion started by: ammu
6 Replies

4. Shell Programming and Scripting

shell script: grep multiple lines after pattern match

I have sql file containing lot of queries on different database table. I have to filter specific table queries. Let say i need all queries of test1,test2,test3 along with four lines above it and sql queries can be multi lines or in single line. Input file contains. set INSERT_ID=1; set... (1 Reply)
Discussion started by: mirfan
1 Replies

5. Shell Programming and Scripting

Sed/awk/perl command to replace pattern in multiple lines

Hi I know sed and awk has options to give range of line numbers, but I need to replace pattern in specific lines Something like sed -e '1s,14s,26s/pattern/new pattern/' file name Can somebody help me in this.... I am fine with see/awk/perl Thank you in advance (9 Replies)
Discussion started by: dani777
9 Replies

6. Shell Programming and Scripting

Printing next 6 lines from of pattern match

Hi, i have a big file having many opcodes. if (opcode="01110000000100000000" ) then --fadd result.opcode := "01110000000100000000"; result.s0 := '1'; result.s1 := '1'; result.s2 := '0'; result.inst := '0'; result.scalar := '1';... (7 Replies)
Discussion started by: twistedpair
7 Replies

7. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

8. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies

9. Shell Programming and Scripting

Remove multiple lines that match pattern

Not sure how I can accomplish this. I would like to remove all interfaces that have the commands I would like to see: switchport port-security, spanning-tree portfast. One line is no problem. interface FastEthernet0/8 spanning-tree portfast interface FastEthernet0/9 spanning-tree... (4 Replies)
Discussion started by: mrlayance
4 Replies

10. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
RDF::Query::Parser(3pm) 				User Contributed Perl Documentation				   RDF::Query::Parser(3pm)

NAME
RDF::Query::Parser - Parser base class VERSION
This document describes RDF::Query::Parser version 2.908. METHODS
"new_literal ( $literal, $language, $datatype )" Returns a new literal structure. "new_variable ( $name )" Returns a new variable structure. "new_blank ( $name )" Returns a new blank node structure. "new_uri ( $uri )" Returns a new variable structure. "new_triple ( $s, $p, $o )" Returns a new triple structure. "new_unary_expression ( $operator, $operand )" Returns a new unary expression structure. "new_binary_expression ( $operator, @operands )" Returns a new binary expression structure. "new_function_expression ( $function, @operands )" Returns a new function expression structure. "new_alias_expression ( $alias, $expression )" Returns a new alias expression structure. "new_filter ( $filter_expr, $pattern )" Returns a new filter structure. "fail ( $error )" Sets the current error to $error. If the parser is in commit mode (by calling "set_commit"), throws a RDF::Query::Error::ParseError object. Otherwise returns "undef". "error ()" Returns the last error the parser experienced. AUTHOR
Gregory Williams <gwilliams@cpan.org> perl v5.14.2 2012-01-31 RDF::Query::Parser(3pm)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy