Sponsored Content
Top Forums UNIX for Dummies Questions & Answers find if a position is between a given start and end position Post 302264278 by fadista on Wednesday 3rd of December 2008 03:48:15 PM
Old 12-03-2008
There would be 355968 entries in the first file and 178845 in the second one.
The ranges of each entry in the first file are always 36.

Best regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check position of end of line(URGENT PLS)

I Have to check in a file that all the lines are ending at same posiotin. Ex : line 1 is ending at position 88 line 2 should at same position i.e 88 Thanks in advance (6 Replies)
Discussion started by: evvander
6 Replies

2. Shell Programming and Scripting

Add 'ENDEND' on end of each record at position is 14-20

I have file format like below and I'm trying to modify this file. I need to add 'ENDEND' end of each record. 01 ASH01 1CTCTL EDPPOO STAND 01 ASH08 0020 A1TH 101 01 ASH09 0022 A1TH 102 01 ASH09 0022 A1TH 103 01 ASH02 2CTCTL ... (5 Replies)
Discussion started by: naveenkcl
5 Replies

3. Shell Programming and Scripting

how to find a position and print some string in the next and same position

I need a script for... how to find a position of column data and print some string in the next line and same position position should find based on *HEADER8* in text for ex: ord123 abs 123 987HEADER89 test234 ord124 abc 124 987HEADER88 test235 ... (1 Reply)
Discussion started by: naveenkcl
1 Replies

4. Shell Programming and Scripting

Subsitute from a position till end of line.

Hi, Having a following file's content, lets say: ABC|ANA|LDJ|||||DKD|||||| AJJ|KKDD||KKDK|||||||||||| KKD||KD|||LLLD||||LLD||||| Problem: Need to replace pipes from 8th occurrence of pipe till end. so the result should be: ABC|ANA|LDJ|||||DKD AJJ|KKDD||KKDK|||| ------- ------- ... (12 Replies)
Discussion started by: _Noprofi
12 Replies

5. Shell Programming and Scripting

Remove text from n position to n position sed/awk

I want to remove text from nth position to nth position couple of times in same line my line is "hello is there anyone can help me with this question" I need like this ello is there anyone can help me with question 'h' is removed and 'this' removed from the line. I want to do this... (5 Replies)
Discussion started by: elamurugu
5 Replies

6. UNIX for Dummies Questions & Answers

extract regions of file based on start and end position

Hi, I have a file1 of many long sequences, each preceded by a unique header line. file2 is 3-columns list: headers name, start position, end position. I'd like to extract the sequence region of file1 specified in file2. Based on a post elsewhere, I found the code: awk... (2 Replies)
Discussion started by: pathunkathunk
2 Replies

7. Shell Programming and Scripting

Need command or script to print all lines from 2nd position to last but one position

hi guys, i want command or script to display the content of file from 2nd position to last but one position of a file abcdefghdasdasdsd 123,345,678,345,323 434,656,656,656,656 678,878,878,989,545 4565656667,65656 i want to display the same above file without first and... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

8. Shell Programming and Scripting

Search for a string at a particular position and replace with blank based on position

Hi, I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies

9. Shell Programming and Scripting

Inserting value at a particular position without changing the position of other characters

Hi All, I wanted a sed/awk command to add a value/character on a particular position without disturbing the position of other characters. I have file a.txt OL 10031 Day Black Midi Good Value P01 P07 OL 10031 Day Black Short Good Value P01 P07 I want to get the output as... (2 Replies)
Discussion started by: rahulsk
2 Replies

10. Shell Programming and Scripting

Retrieving sequences corresponding to start and end position

Hi all, I have a fasta file of a reference sequnce, I will like to retrieve sequences corresponding to a list of start and end position in another file >my_ref_seq GCCCTATAAGGGCAGAAGCTTGTCCTTCTTGTGCCAGTTATGACGTTTGTCCTAACTGCACATCTGGTAG... (4 Replies)
Discussion started by: Ibk
4 Replies
DWARF_GET_RANGES(3)					   BSD Library Functions Manual 				       DWARF_GET_RANGES(3)

NAME
dwarf_get_ranges -- retrieve non-contiguous address ranges LIBRARY
DWARF Access Library (libdwarf, -ldwarf) SYNOPSIS
#include <libdwarf.h> int dwarf_get_ranges(Dwarf_Debug dbg, Dwarf_Off offset, Dwarf_Ranges **ranges, Dwarf_Signed *cnt, Dwarf_Unsigned *byte_cnt, Dwarf_Error *err); int dwarf_get_ranges_a(Dwarf_Debug dbg, Dwarf_Off offset, Dwarf_Die die, Dwarf_Ranges **ranges, Dwarf_Signed *cnt, Dwarf_Unsigned *byte_cnt, Dwarf_Error *err); DESCRIPTION
Function dwarf_get_ranges() retrieves information about the non-contiguous address ranges associated with a DWARF debugging information entry. Information about address ranges is returned as an array of descriptors of type Dwarf_Ranges, with each Dwarf_Ranges descriptor describing one address range entry. Argument dbg should reference a DWARF debug context allocated using dwarf_init(3). Argument offset is an offset, relative to the ``.debug_ranges'' section, to the start of the desired list of address ranges. The offset of an address ranges list is indicated by the DW_AT_ranges attribute of a debugging information entry. Argument die (function dwarf_get_ranges_a() only) is ignored in this implementation; see the section Compatibility Notes below. Argument ranges should point to a location that will be set to a pointer to an array of Dwarf_Ranges descriptors. Argument cnt should point to a location that will be set to the number of entries returned. If argument byte_cnt is not NULL, it will be set to the number of bytes occupied by the returned entries in the ``.debug_ranges'' section. If argument err is not NULL, it will be used to store error information in case of an error. Dwarf_Ranges descriptors are defined in the header file <libdwarf.h>, and consists of the following fields: dwr_addr1 The first address offset, whose meaning depends on the type of the entry. dwr_addr2 The second address offset, whose meaning depends on the type of the entry. dwr_type The type of this address range entry: DW_RANGES_ENTRY A range list entry. For this type of entry, the fields dwr_addr1 and dwr_addr2 hold the beginning and ending offsets of the address range, respectively. DW_RANGES_ADDRESS_SELECTION A base address selection entry. For this type of entry, the field dwr_addr1 is the value of the largest repre- sentable address offset, and dwr_addr2 is a base address for the begining and ending address offsets of subse- quent address range entries in the list. DW_RANGES_END An end of list mark. Both dwr_addr1 and dwr_addr2 are set to 0. Memory Management The memory area used for the array of Dwarf_Ranges descriptors returned in argument ranges is owned by the DWARF Access Library (libdwarf, -ldwarf). The application should not attempt to directly free this pointer. Portable code should instead use dwarf_ranges_dealloc() to indicate that the memory may be freed. COMPATIBILITY
Function dwarf_get_ranges_a() is identical to dwarf_get_ranges(), except that it requires one additional argument die denoting the debugging information entry associated with the address range list. In this implementation of the DWARF Access Library (libdwarf, -ldwarf), the argu- ment die is ignored, and function dwarf_get_ranges_a() is only provided for compatibility with other implementations of the DWARF(3) API. RETURN VALUES
These functions return DW_DLV_OK when they succeed. They return DW_DLV_NO_ENTRY if there is no address range list at the specified offset offset. In case of an error, they return DW_DLV_ERROR and set the argument err. ERRORS
These function can fail with: [DW_DLE_ARGUMENT] One of the arguments dbg, ranges or cnt was NULL. [DW_DLE_NO_ENTRY] There is no address range list at the specified offset offset. EXAMPLE
To retrieve the address range list associated with a debugging information entry, use: Dwarf_Debug dbg; Dwarf_Die die; Dwarf_Error de; Dwarf_Addr base; Dwarf_Attribute *attr_list; Dwarf_Ranges *ranges; Dwarf_Signed cnt; Dwarf_Unsigned off, attr_count, bytecnt; int i, j; if ((ret = dwarf_attrlist(die, &attr_list, &attr_count, &de)) != DW_DLV_OK) errx(EXIT_FAILURE, "dwarf_attrlist failed: %s", dwarf_errmsg(de)); for (i = 0; (Dwarf_Unsigned) i < attr_count; i++) { if (dwarf_whatattr(attr_list[i], &attr, &de) != DW_DLV_OK) { warnx("dwarf_whatattr failed: %s", dwarf_errmsg(de)); continue; } if (attr != DW_AT_ranges) continue; if (dwarf_formudata(attr_list[i], &off, &de) != DW_DLV_OK) { warnx("dwarf_formudata failed: %s", dwarf_errmsg(de)); continue; } if (dwarf_get_ranges(dbg, (Dwarf_Off) off, &ranges, &cnt, &bytecnt, &de) != DW_DLV_OK) continue; for (j = 0; j < cnt; j++) { if (ranges[j].dwr_type == DW_RANGES_END) break; else if (ranges[j].dwr_type == DW_RANGES_ADDRESS_SELECTION) base = ranges[j].dwr_addr2; else { /* * DW_RANGES_ENTRY entry. * .. Use dwr_addr1 and dwr_addr2 .. */ } } } SEE ALSO
dwarf(3), dwarf_ranges_dealloc(3) BSD
November 9, 2011 BSD
All times are GMT -4. The time now is 03:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy