This is a quick example. There are probably other ways to do it, but this is straight forward:
It does assume that each section starts with an asterisk (*) and that if it is continued onto multiple lines the section ends with the next asterisk or a blank line. The output from each section is put on one line (no intermediate newlines) even if it was on multiple lines in the input. Each section is placed on a separate line.
Hope this helps.
Last edited by agama; 08-30-2010 at 11:59 PM..
Reason: Clarification in description
suppose if u have a file like that
Hen ABCCSGSGSGJJJJK 15
Cock ABCCSGGGSGIJJJL 15
* * * * * * : * * * . * * * :
Hen CFCDFCSDFCDERTF 30
Cock CHCDFCSDHCDEGFI 30
* . * * * * * * * : * * :* : : .
The output shud be
where there is : and .
It shud... (4 Replies)
Sorry for the duplicate thread this one is similar to the one in
https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121
Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Hi,
I need an awk command that would parse the below expression
Input Format
1 'Stmt1 ............................'2 'Stmt2 ............................'3 'Stmt3 ............................'4 'Stmt4 ............................'5 'Stmt5 ............................'6 'Stmt6... (1 Reply)
Hi folks,
I have XML files with the following sections (section occurs once per file) in them:
<AuthorList CompleteYN="Y">
<Author ValidYN="Y">
<LastName>Bernal</LastName>
<ForeName>Federico</ForeName>
... (3 Replies)
Hi
I am trying to figure out the best way to search a long log file and print out certain information.
For example if I had a line in a log file delimited by ampersand
first_name=mike&last_name=smith&zip_code=55555&phone=555-5555&state=ma&city=boston
and I only wanted to search for and... (3 Replies)
Hello all gurus,
I have a long list of rules as below:
20 name:abc addr:203.45.247.247/255.255.255.255 WDW-THRESH:12 BW-OUT:10000000bps BW-IN:15000000bps STATSDEVICE:test247 STATS:Enabled (4447794/0) <IN OUT>
25 name:xyz160 addr:203.45.233.160/255.255.255.224 STATSDEVICE:test160... (3 Replies)
Hi,
I have a quick question on parsing the hour/minute and value from a text file and remove the seconds portion. For example in the below text file:
20:26:01 95.83
20:27:01 96.06
20:28:01 95.99
20:29:01 7.11
20:30:01 5.16
20:31:01 8.27
20:32:02 9.79
20:33:01 11.27
20:34:01 7.83... (2 Replies)
I am trying using awk to open an input file and check a column 2/field $2 and if there is a warning then that is displayed (variantchecker): G not found at position 459, found A instead. The attached Sample1.txt is that file. If in that column/field there is a black space, then the text after... (6 Replies)
Hello Friends!
I would like to help the masters ... I have a file with the entry below and would like a script for that output:
Input file:
001 1 01-20152142711532-24S 1637909825/05/2015BAHIA SERVICOS R F, ... (1 Reply)
I am trying to parse the input in awk to include the |gc= in $4 but am not able to. The below is close:
awk so far:
awk '{sub(/\|]+]++/, ""); print }' input.txt Input
chr1 955543 955763 AGRN-6|pr=2|gc=75 0 +
chr1 957571 957852 AGRN-7|pr=3|gc=61.2 0 +
chr1 970621 ... (7 Replies)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT HPUX
elf_strptr
elf_strptr(3E)elf_strptr(3E)NAME
elf_strptr - make a string pointer
SYNOPSIS
[flag... ] file... [library] ...
DESCRIPTION
This function converts a string section offset to a string pointer. elf identifies the file in which the string section resides, and sec-
tion gives the section table index for the strings. normally returns a pointer to a string, but it returns a null pointer when elf is
null, section is invalid or is not a section of type the section data cannot be obtained, offset is invalid, or an error occurs.
EXAMPLES
A prototype for retrieving section names appears below. The file header specifies the section name string table in the member. The fol-
lowing code loops through the sections, printing their names.
if ((ehdr = elf32_getehdr(elf)) == 0)
{
/* handle the error */
return;
}
ndx = ehdr->e_shstrndx;
scn = 0;
while ((scn = elf_nextscn(elf, scn)) != 0)
{
char *name = 0;
if ((shdr = elf32_getshdr(scn)) != 0)
name = elf_strptr(elf, ndx,
(size_t)shdr->sh_name);
printf("'%s'
", name? name: "(null)");
}
Note
A program may call to retrieve an entire string table section. For some applications, that would be both more efficient and more conve-
nient than using
SEE ALSO elf(3E), elf_getdata(3E), elf_getshdr(3E), elf_xlate(3E).
elf_strptr(3E)