Sponsored Content
Top Forums Shell Programming and Scripting searching multiple patterns in perl Post 302512879 by DGPickett on Monday 11th of April 2011 08:00:22 PM
Old 04-11-2011
Split your if-two-patterns into two if-one-patterns, the rel one saves in a variable (what rel am I in), the other prints that variable.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Match a line with multiple search patterns

Hi I'm not very good with the serach patterns and I'd need a sample how to find a line that has multiple patterns. Say I want to find a line that has "abd", "123" and "QWERTY" and there can be any characters or numbers between the serach patterns, I have a file that has thousands of lines and... (10 Replies)
Discussion started by: Juha
10 Replies

2. Shell Programming and Scripting

Perl - How to search a text file with multiple patterns?

Good day, great gurus, I'm new to Perl, and programming in general. I'm trying to retrieve a column of data from my text file which spans a non-specific number of lines. So I did a regexp that will pick out the columns. However,my pattern would vary. I tried using a foreach loop unsuccessfully.... (2 Replies)
Discussion started by: Sp3ck
2 Replies

3. UNIX for Dummies Questions & Answers

Perl searching and printing multiple target in the same line

Hello, I'm trying to create a program in perl called myfind.pl; To use the program: (at the command line)$ program.pl keyword filename note: the keyword is any word or regular expression and it should display the result just like when you 'cat' the file name but with the keyword in... (2 Replies)
Discussion started by: Horizon666
2 Replies

4. Shell Programming and Scripting

Searching for multiple patterns in files

I have a situation where I need to search for multiple strings (error messages) such as 'aborted' 'file not found' etc in directory having logs. I have put all the error messages in a text file and using the command. grep -f <textfile> <filetobegrepped> I'm doing this thru a script where I... (5 Replies)
Discussion started by: bornon2303
5 Replies

5. Shell Programming and Scripting

Perl, searching multiple files and printing returned line to new file

I am trying to find a way to utilise the full potential of my cpu cores and memory on my windows machine. Now, I am quite familiar with grep, however, running a Unix based OS is not an option right now. Unfortunately, the 32 bit grep for windows that I am running, I cannot run multiple... (1 Reply)
Discussion started by: Moloch
1 Replies

6. Shell Programming and Scripting

Searching for multiple patterns in a file

Hi All, I have a file in which i have to search for a pattern from the beginning of the file and if the pattern is found , then i have to perform a reverse search from that line to the beginning of the file to get the first occurrence of another pattern. sample input file hey what are you... (8 Replies)
Discussion started by: Kesavan
8 Replies

7. UNIX for Dummies Questions & Answers

Grep in Perl - Searching through multiple files

I'm attempting to use grep in Perl with very little success. What I would like to do in Perl is get the output of the following grep code: grep -l 'pattern' * This gives me a list of all the files in a directory that contain the pattern that was searched. My attempts to do this in Perl... (4 Replies)
Discussion started by: WongSifu
4 Replies

8. Shell Programming and Scripting

a column containing multiple patterns perl

If U have a question if a file is 33 ABC 276 LRR pir UJU 45 BCD 777 HIGH pred IJJ 67 BGH 66 LRR_1 prcc KIK 77 GYH 88 LOW pol KKK perl -lne '$a++ if /LRR/,/LOW/, /HIGH/; END {print $a+0}' (2 Replies)
Discussion started by: cdfd123
2 Replies

9. Shell Programming and Scripting

Searching multiple patterns using awk

Hello, I have the following input file: qh1adm 20130710111201 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ qh1adm 20130711151154 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ qx1adm 20130711151154 : tp count QX1 u6 -Dsourcesystems=B17,E17,EE7 qh1adm 20130711151155 : tp import all... (7 Replies)
Discussion started by: kcboy
7 Replies

10. Shell Programming and Scripting

Searching multiple patterns and construct SQL

Hello, I have attached 2 files 1) Original_table_definition.txt => which has definition of 3 tables 2) describe_table_output.txt => which has again 3 tables definition gotten thorugh doing a show table or describe table way. Now difference between 3 tables are that tablea has no... (2 Replies)
Discussion started by: nv186000
2 Replies
Gedcom::Family(3pm)					User Contributed Perl Documentation				       Gedcom::Family(3pm)

NAME
Gedcom::Family - a module to manipulate Gedcom families Version 1.16 - 24th April 2009 SYNOPSIS
use Gedcom::Family; my @rel = $f->husband; my @rel = $f->wife; my @rel = $f->parents; my $nch = $f->number_of_children; my @rel = $f->children; my @rel = $f->boys; my @rel = $f->girls; $f->add_husband($i); $f->add_wife($i); $f->add_child($i); DESCRIPTION
A selection of subroutines to handle families in a gedcom file. Derived from Gedcom::Record. HASH MEMBERS
None. METHODS
None yet. Individual functions my @rel = $f->husband; my @rel = $f->wife; my @rel = $f->parents; my @rel = $f->children; my @rel = $f->boys; my @rel = $f->girls; Return a list of individuals from family $f. Each function, even those with a singular name such as husband(), returns a list of individuals holding that releation in $f. number_of_children my $nch = $f->number_of_children; Return the number of children in the family, as specified or from counting. Add functions $f->add_husband($i); $f->add_wife($i); $f->add_child($i); Add the specified individual to the family in the appropriate position. These functions also take care of the references from the individual back to the family, and are to be preferred to the low level addition functions which do not do this. perl v5.14.2 2012-04-12 Gedcom::Family(3pm)
All times are GMT -4. The time now is 11:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy