Hi There!
My final task for today is to delete lines starting with certain numbers
for e.g., my text block is
and i want to delete all lines starting with 11 or 17 or 21
I know i can use multiple sed commands like
sed '/^11,/d' <filename>
sed '/^17,/d' <filename>
sed '/^21,/d'... (2 Replies)
Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
Hi,
I have a file such as:
---
>contig00001 length=35524 numreads=2944
gACGCCGCGCGCCGCGGCCAGGGCTGGCCCA
CAGGCCGCGCGGCGTCGGCTGGCTGAG
>contig00002 length=4242 numreads=43423
ATGCCGAAGGTCCGCCTGGGGCTGG
CGCCGGGAGCATGTAGCG
---
I would like to concatenate the lines not starting with ">"... (9 Replies)
Hello sed gurus. I am using ksh on Sun and have a file created by concatenating several other files. All files contain header rows. I just need to keep the first occurrence and remove all other header rows.
header for file
1111
2222
3333
header for file
1111
2222
3333
header for file... (8 Replies)
Hi, just tried some script, awk, sed for the last 2 hours and now need help.
Let's say I have a huge file of 800,000 lines like this :
It's a tedious job to look through it, I'd like to remove those useless lines in it as there's a few thousands :
Or to be even more precise :
if line1 =... (6 Replies)
Platform : RHEL 5.8
I have text file called myapplication.log . In this file, I have around 800 lines which start with the followng three strings
PWRBRKER-3493
PWRBRKER-7834
SCHEDULER-ERROR
How can I delete these lines in one go ? (13 Replies)
Dear all,
I would like to delete even lines starting with "N" together with their respective titles which are actually odd lines.
Below is the example of input file. I would like to remove line 8 and 12 together with its title line, i.e., line 7 and 11, respectively.... (2 Replies)
Hi all!
Thanks for taking the time to view this!
I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern.
Example:
Drink a soda
Eat a banana
Eat multiple bananas
Drink an apple juice
Eat an apple
Eat multiple apples
I... (8 Replies)
Tool used : VIM editor that comes with RHEL 7.4
I have a file like below. It has around 300 lines like below. All the lines starting with # are comments.
For readability, I removed all lines starting with # from vi (vim editor) using the command :g/^#/d . It seemed to have worked.
But, which... (8 Replies)
Shell : bash
OS : RHEL 6.8
I have a file like below.
$ cat pattern.txt
hello
txt1
txt2
txt3
some other text
txt4
I want to remove all lines in this file except the ones starting with txt . How can I do this ? (4 Replies)
Discussion started by: omega3
4 Replies
LEARN ABOUT CENTOS
__pmspeclocalpmda
PMSPECLOCALPMDA(3) Library Functions Manual PMSPECLOCALPMDA(3)NAME
__pmSpecLocalPMDA - process command-line argument for the table of DSO PMDAs
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/impl.h>
char *__pmSpecLocalPMDA(const char *spec);
cc ... -lpcp
DESCRIPTION
PCP contexts of type PM_CONTEXT_LOCAL are used by clients that wish to fetch metrics directly from one or more PMDAs on the local host
without involving pmcd(1).
__pmSpecLocalPMDA provides a convenience wrapper to be used by applications that wish to use a command line argument (usually with -K) to
control the DSO PMDAs that are available for a PM_CONTEXT_LOCAL context.
The spec argument specifies actions for one or more DSO PMDAs using up to four fields separated by commas (``,''), namely:
- an opcode with one of the values add (add a new entry), del (delete an existing entry) or clear (clear all entries from the table).
- the PMDA's domain number
- the path to the PMDA DSO (may be absolute or relative to the $PCP_VAR_DIR/pmdas directory and the DSO suffix is optional), and
- the name of the PMDA's initialization routine.
All fields are required to add a new entry. To delete an entry the opcode is required plus either or both of the domain number and path
fields. To clear all entries, only the opcode is required.
If spec is parsed successfully, then __pmLocalPMDA(3) is called with the extracted arguments.
RETURN VALUE
On success, __pmSpecLocalPMDA will return NULL.
On error or failure, __pmSpecLocalPMDA will return a pointer to a static error message.
EXAMPLES
Some examples of valid spec strings:
clear Delete all entries from the DSO table.
add,123,foo/foo_pmda,foo_init
Add the ``foo'' PMDA using domain 123. The PMDA's DSO is most likely in below the directory $PCP_PMDAS_DIR and named
foo/foo_pmda.so (for ELF-style platforms) or foo/foo_pmda.dylib (for BSD-style platforms) or fooo_pmda.dll (for Windows-style plat-
forms). The initialization routine for the ``foo'' PMDA is foo_init().
del,123
Delete the entry for the DSO with domain 123.
del,,foo/foo_pmda
Delete the entry with a pathname to the DSO that matches foo/foo_pmda.
del,123,foo/foo_pmda
Delete the entry for the DSO with either domain 123 and/or a pathname to the DSO that matches foo/foo_pmda.
SEE ALSO PMAPI(3), __pmLocalPMDA(3) and pmNewContext(3).
Performance Co-PilotPMSPECLOCALPMDA(3)