Thanks for that Scrutinizer - so very close to what I need! If I've got it correct, it only displays if all three patterns are found, ideally it would be great if it could print every line with 1 or more matches:
or just blank rather than 0 G on the MEMLIMIT. Basically every entry _should_ have a 'Started on' and a MEM:, but not necessarily a MEMLIMIT
Last edited by chrissycc; 10-13-2013 at 07:46 AM..
Reason: correction
In a directory, there are two different file extensions (*.txt and *.xyz) having similar names of numerical strings (*). The (*.txt) contains 5000 multiple files and the (*.xyz) also contains 5000 multiple files. Each of the files has around 4000 rows and 8 columns, with several unique string... (5 Replies)
I have the following in an awk script. I want to do them on condition that: fext == "xt"
FNR == NR {
/>/ && idx = ++i
$2 || val = $1
next
}
FNR in idx { v = val] }
{ !/>/ && srdist = abs($1 - v) }
/>/ || NF == 2 && srdist < dsrmx {... (1 Reply)
I am trying to extract multiple strings from snmp-mib files like below.
-----
$ cat IF-MIB.mib
<snip>
linkDown NOTIFICATION-TYPE
OBJECTS { ifIndex, ifAdminStatus, ifOperStatus }
STATUS current
DESCRIPTION
"A linkDown trap signifies that the SNMP entity, acting in... (5 Replies)
Hi Folks,
I have two arrays
a:
aaa bbb ccc ddd
ddd aaa bbb ccc
ddd ccc aaa bbb
b:
aaa bbb ccc
aaa ccc bbb
bbb aaa ccc
ccc bbb aaa
I want to compare row by row a(c1:c4) to b(c1:c3). If elements of 'b' match... (5 Replies)
I need to extract multiple occurance strings between 2 different patterns in given line.
For e.g. in below as input
-------------------------------------------------------------------------------------
mike(hussey) AND mike(donald) AND mike(ryan) AND mike(johnson)... (8 Replies)
Hello
I have an output that has a string between quotes and another between square brackets on the same line. I need to extract these 2 strings Example line
Device "nrst3a" attributes=(0x4) RAW SERIAL_NUMBER=SNL2
Output should look like
nrst3a VD073AV1443BVW00083
I was trying with sed... (3 Replies)
Hi,
I have multiple files in my log folder. e.g:
a_m1.log
b_1.log
c_1.log
d_1.log
b_2.log
c_2.log
d_2.log
e_m1.log
a_m2.log
e_m2.log
I need to keep latest 10 instances of each file.
I can write multiple find commands but looking if it is possible in one line.
m file are monthly... (4 Replies)
Hi,
I need help to match patterns from between two different files and extract region of strings.
inputfile1.fa
>l-WR24-1:1
GCCGGCGTCGCGGTTGCTCGCGCTCTGGGCGCTGGCGGCTGTGGCTCTACCCGGCTCCGG
GGCGGAGGGCGACGGCGGGTGGTGAGCGGCCCGGGAGGGGCCGGGCGGTGGGGTCACGTG... (4 Replies)
Discussion started by: bunny_merah19
4 Replies
LEARN ABOUT CENTOS
ptargrep
PTARGREP(1) User Contributed Perl Documentation PTARGREP(1)NAME
ptargrep - Apply pattern matching to the contents of files in a tar archive
SYNOPSIS
ptargrep [options] <pattern> <tar file> ...
Options:
--basename|-b ignore directory paths from archive
--ignore-case|-i do case-insensitive pattern matching
--list-only|-l list matching filenames rather than extracting matches
--verbose|-v write debugging message to STDERR
--help|-? detailed help message
DESCRIPTION
This utility allows you to apply pattern matching to the contents of files contained in a tar archive. You might use this to identify all
files in an archive which contain lines matching the specified pattern and either print out the pathnames or extract the files.
The pattern will be used as a Perl regular expression (as opposed to a simple grep regex).
Multiple tar archive filenames can be specified - they will each be processed in turn.
OPTIONS --basename (alias -b)
When matching files are extracted, ignore the directory path from the archive and write to the current directory using the basename of
the file from the archive. Beware: if two matching files in the archive have the same basename, the second file extracted will
overwrite the first.
--ignore-case (alias -i)
Make pattern matching case-insensitive.
--list-only (alias -l)
Print the pathname of each matching file from the archive to STDOUT. Without this option, the default behaviour is to extract each
matching file.
--verbose (alias -v)
Log debugging info to STDERR.
--help (alias -?)
Display this documentation.
COPYRIGHT
Copyright 2010 Grant McLean <grantm@cpan.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.16.3 2013-05-12 PTARGREP(1)