Hello,
Actually i want to replace the word after a matched pattern.
For Ex:
lets say that i am reading a file line by line
while read line
do
echo $line
# i need to search whether a pattern exists in the file and replace the word after if the pattern exist.
# for example :... (1 Reply)
Hi,
If there exist multiple pattern in a file, how can I find the last record matching the pattern through perl.
The below script searches for the pattern everywhere in an input file.
#! /usr/bin/perl -s -wnl
BEGIN {
$pattern or
warn"Usage: $0 -pattern='RE' \n" and
exit 255;... (5 Replies)
would like to print word between matched patterns using sed
for example :
create INDEX SCOTT.OR_PK ON table_name(....)
would like to print between SCOTT. and ON which is OR_PK
Please help me out
Thanks (4 Replies)
Hello every,
I am stuck in a problem. I have file like this. I want to add the fifth field of the match pattern line above the lines starting with "# @D". The delimiter is "|"
eg
>
# @D0.00016870300|0.05501020000|12876|12934|3||Qp||Pleistocene||"3 Qp Pleistocene"|Q
# @P... (5 Replies)
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
hi,
i have a variable which contains some file names delimited by a single space.
FNAME="s1.txt s2.lst s3.cvs s4.lst"
i have another variable that contains a pattern
FILE_PATTERN="*.lst"
i want to take the filenames from FNAME variable and assign each file name in to an array say
for... (8 Replies)
Hi,
I need to extract an info in $1 based on a matched pattern in $2,$3,$4, and $5.
The sample input file as follows:-
ID Pat1 Pat2 Pro1 use1
add41 M M M
add87 M M M M
add32 ... (16 Replies)
What I would like to do is if the lines with % have the same name, then combine the last 9 letters of the string underneath the last occurrence of that ID with the first 9 letters of the string underneath the first occurrence of that ID.
I have a file that looks like this:
%GOGG... (12 Replies)
Hi I want to print the line until pattern is matched.
I am using below code:
sed -n '1,/pattern / p' file
It is working fine for me , but its not working for exact match.
sed -n '1,/^LAC$/ p' file
Input:
LACC FEGHRA 0
LACC FACAF 0
LACC DARA 0
LACC TALAC 0
LAC ILACTC 0... (8 Replies)
I have two files say FILE1 and FILE2.
FILE1 contains 80,000 filename in sorted order and another file FILE2 contains 6,000 filenames is also in sorted order.
I want to compare the filename for each file and copy them in to a folder when filename is matched.
File1.txt contain 80,000... (8 Replies)
Discussion started by: imranrasheedamu
8 Replies
LEARN ABOUT HPUX
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)