How to search multiple patterns and remove lines from a file?
Hi,
I have a file content as below.
Where ever the header lines (lines start with Table, Displayed fieleds,| |HBKID,--- ) present , I have to remove these lines from the file to process the file further steps. Pls help me.
Moderator's Comments:
Use code tags please, see PM.
Last edited by zaxxon; 07-31-2013 at 06:27 AM..
Reason: code tags
I have one file:
123*100*abcd*10
123*101*abcd*-29*def
123*100*abcd*-10
123*102*abcd*-105*asd
I would like to parameterize the search patterns in the following way so that the user could dynamically change the search pattern.
*100* and *- (ie *minus)
*102* and *-
The output that is... (6 Replies)
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)
I'm trying to parse COBOL code to combine variables into one string. I have two variable names that get literals moved into them and I'd like to use sed, awk, or similar to find these lines and combine the variables into the final component. These variable names are always VAR1 and VAR2. For... (8 Replies)
Hello,
I've searched through the scripting section but could not find what I need.
I need to search for empty sections within a file and remove them.
Here is an example file:
Title 123
A
B
C
D
E
Title 098
Title 567
Z
Y (4 Replies)
Hi,
I have to write one script that has to search a list of numbers in certain zipped files.
For eg. one file file1.txt contains the numbers. File1.txt contains 5,00,000 numbers and I have to search each number in zipped files(The number of zipped files are around 1000 each file is 5 MB)
I have... (10 Replies)
I have two lists in a file that look like
a b
b a
e f
c d
f e
d c
I would like a final list
a b
c d
e f
I've tried multiple grep and awk but can't get it to work (8 Replies)
Hi,
I am new to shell scripting and is working on a script to extract lines from a log file between two time stamps using awk command. After some research I used following command:
awk '/01 Oct 2011/{p=1} /10 Oct 2011/{p=0} p' test.log >> tmp.log
This works fine. But now i want to... (3 Replies)
im using the following code to search a log for entries on two different lines:
awk 'BEGIN{count=0} /'"${firstpattern}"'/,/'"${secondpattern}"'/ { print; if ($0 ~ /'"${thirdpattern}"'/){count++}; } END { print count }' data.txt
firstpattern="start error log"
secondpattern="i am logging the... (1 Reply)
Hi all,
I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex:
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
LEARN ABOUT HPUX
pipcs
pipcs(1) General Commands Manual pipcs(1)NAME
pipcs - report status of POSIX interprocess communication facilities
SYNOPSIS
qname]]
DESCRIPTION
displays certain information on active POSIX interprocess communication facilities. When no options are specified, displays information in
short format for the POSIX message queues and POSIX named semaphores that are currently active in the system.
Options
The following options restrict the display to the corresponding facilities.
(none) This is equivalent to
Display details for the POSIX message queue specified
in the qname argument.
Display the list of processes and users using the
POSIX message queues.
Display information on active POSIX message queues.
Display information on active POSIX named semaphores.
Display the creation time and last modification time of
the POSIX message queues.
The options, and can be used only with the option. The options and are mutually exclusive.
The following options add columns of data to the display. See "Column Description" below.
(none) Display default columns: for all facilities:
Display all columns, as appropriate.
This is equivalent to
Display largest-allowable-size information:
for POSIX message queues:
Display information on outstanding usage:
for POSIX message queues: for POSIX named semaphores:
Column Descriptions
The column headings and the meaning of the columns in an listing are given below. The columns are printed from left to right in the order
shown below.
Facility type:
POSIX message queue
POSIX named semaphore
The facility access modes and flags.
The mode consists of nine characters that are interpreted as three sets of three characters each. The first set refers to the
owner's permissions, the next to permissions of others in the group of the facility entry, and the last to all others.
Within each set, the first character indicates permission to read, the second character indicates permission to write or alter the
facility entry, and the last character is currently unused.
Read permission is granted.
Write permission is granted.
Alter permission is granted.
The indicated permission is not granted.
The login name of the owner of the facility entry.
The group name of the group of the owner of the facility entry.
The reference count value of the facility entry.
Reference count of the POSIX message queue represents number of simultaneous open for the associated one. Similarly reference count
of the POSIX named semaphore represents number of process referencing the associated one.
The name of the facility entry.
The number of messages currently outstanding
on the associated POSIX message queue.
The maximum number of messages allowed
on the associated POSIX message queue.
The maximum number of bytes allowed
in messages outstanding on the associated POSIX message queue.
The current value on the associated POSIX named semaphore.
The initial value hold on the associated POSIX named semaphore.
WARNINGS
produces only an approximate indication of actual system status because system processes are continually changing while is acquiring the
requested information.
Do not rely on the exact field widths and spacing of the output, as these will vary depending on the system, the release of HP-UX, and the
data to be displayed.
EXAMPLES
List the processes and users using the POSIX message queues. Note that "None" is displayed if there are no processes using the POSIX mes-
sage queue.
pipcs -qP
/mq/0 :
1234457645 (root)
5433483354 (vts)
/mq/1 : None
/mq/2 :
8344835378 (user1)
List the processes and users using the POSIX message queue
pipcs -qP -N /mq/2
/mq/2 :
8344835378 (user1)
List the creation time and last modification time of the POSIX message queues. Ctime denotes creation time and Ltime denotes last modifi-
cation time.
pipcs -qT
/mq/0 :
Ctime : Mon Feb 4 05:06:40 PST 2006
Ltime : Mon Feb 6 11:06:40 PST 2006
/mq/abcd :
Ctime : Mon Feb 2 03:06:40 PST 2006
Ltime : Mon Feb 5 03:06:40 PST 2006
List the creation time and last modification time of the POSIX message queue
pipcs -qT -N /mq/0
/mq/0 :
Ctime : Mon Feb 4 05:06:40 PST 2006
Ltime : Mon Feb 6 11:06:40 PST 2006
FILES
Group names
User names
SEE ALSO pipcrm(1), mq_close(2), mq_open(2), mq_receive(2), mq_send(2), mq_unlink(2), sem_close(2), sem_open(2), sem_post(2), sem_unlink(2),
sem_wait(2).
pipcs(1)