Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Search and replace with a sliding window Post 302907438 by Fahmida on Friday 27th of June 2014 10:56:43 PM
Old 06-27-2014
Hi bakunin
thanks for taking the time to go through it and providing the example.
you are right:
DD!! # after second passis exactly what I need.
This is irrespective of the codon, reading frame etc and to do with replacing the C's in the CHH methylation context.
So it'll be really helpful if a piece of code that will be able to it in multiple pass as you explained.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

2. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

3. Shell Programming and Scripting

Script help: sliding time windows

I have a script like this ... #!/bin/ksh database=$(echo $@ | sed 's/.*-S \(*\).*/\1/') instance=$(grep $database /var/opt/oracle/oratab | awk -F : '{print $1}') command=$(echo $@ | sed "s/$database/$instance/") echo $command if I execute this script in ksh or bash it works fine . ... (3 Replies)
Discussion started by: talashil
3 Replies

4. Shell Programming and Scripting

Sliding window for sequencing data

Hi! I have some sequencing data that I have aligned using maq software Now, I have data that looks like this each line is a 'tag' chr1 10001 chr1 10002 chr1 10005 chr1 10007 chr1 10008 chr1 10008 chr1 10008 chr1 10019 chr1 10019 chr1 10020 What I really want to find out is how... (1 Reply)
Discussion started by: biobio
1 Replies

5. UNIX for Dummies Questions & Answers

Sliding window

Very simple problem I am not able to solve. I have been trying to modify the following code: awk '{t=$1; c = x}{for (i = 1; i <= length; i += wn)print t FS"" substr($2, i, mx) > ("block" ++c)}' mx=100 wn=100 infile.txt What I am tryng to acccomplish, I have a bunch of files where the first... (3 Replies)
Discussion started by: Xterra
3 Replies

6. UNIX for Dummies Questions & Answers

"Sliding window" with variables

I'm doing a little work that involves computing the average completion time of the last 5 of many file decompressions. It's not too tough, but I'm wondering if maybe there's a better way to write it. This is a bash script; here's the current idea: ctime5=$ctime4 ctime4=$ctime3 ctime3=$ctime2... (2 Replies)
Discussion started by: treesloth
2 Replies

7. Shell Programming and Scripting

Sliding window for string manipulation

I have a sting of "0"s and "1"s that I need to analyze. I need to look at each "1" and determine if it is in a neighborhood that is enriched for "1"s which means it is one of at least three "1"s in a 4 character window. My desired output is a count of "1"s in an enriched area. For Example Input... (1 Reply)
Discussion started by: monstrousturtle
1 Replies

8. Shell Programming and Scripting

How do add values in a vector using a sliding window?

Greetings. I have a vector of numbers such as the following: 1 75 79 90 91 92 109 120 167 198 203 204 206 224 230 236 240 (4 Replies)
Discussion started by: Twinklefingers
4 Replies

9. Shell Programming and Scripting

Nested search in a file and replace the inner search

Hi Team, I am new to unix, please help me in this. I have a file named properties. The content of the file is : ##Mobile props east.url=https://qa.east.corp.com/prop/end west.url=https://qa.west.corp.com/prop/end south.url=https://qa.south.corp.com/prop/end... (2 Replies)
Discussion started by: tolearn
2 Replies

10. Programming

Xlib search window by his name

Hello, I just try to get the control of a Window by searching his name. I curretly do that : Window CMD::window_from_name_search(Display *display, Window current, char const *needle) { Window retval, root, parent, *children; unsigned children_count; char *name = NULL; ... (0 Replies)
Discussion started by: Loustak
0 Replies
uwx(3X) 																   uwx(3X)

NAME
uwx() - Unwind Express Library SYNOPSIS
[flag... ] file... [library] ... DESCRIPTION
The Unwind Express Library is a lightweight library for unwinding a process stack on Integrity systems. It may be used for "self-unwind- ing," where a thread traces back through its own stack, or for "cross-unwinding," where a debugger or other tool can examine the stack of another target thread or process. To use the Unwind Express Library, link your application with the option on the compiler or linker command line. All source code should include the header file Source code that uses the library for self-unwinding should also include the header file The Unwind Express Library maintains its entire state within a single unwind environment structure. To unwind a stack, the client applica- tion provides an initial context to the unwind environment, then unwinds the stack one frame at a time. After reaching the bottom of the stack, the unwind environment may be reused for a subsequent unwind operation simply by providing a new initial context, or it may be dis- carded, freeing the memory it was using. A client application may create any number of separate unwind environments, and each one will operate independently of and completely unaf- fected by the others. The Unwind Express Library consists of a core unwind engine that can be adapted to specific environments through the use of callback rou- tines. For self-unwinding, a set of standard callback routines are provided as part of the library. For cross-unwinding, the client must supply callback routines to interface the unwind engine to the target thread or process. Self-Unwinding To prepare for self-unwinding, a client application must perform the following steps to create and initialize a new unwind environment: 1. Call to create a new unwind environment. The return value is a pointer to the unwind environment. 2. Call to initialize the standard callback environment. The return value is a pointer to the callback info structure. 3. Call to register the standard callbacks: and The steps above may be performed at any time in advance of performing a stack unwind. The resulting unwind environment can then be used repeatedly. To perform a stack unwind from some point in the application, the client must perform the following steps: 1. Call to provide the current thread's context as a starting point for unwinding. The stack frame for the caller of this function becomes the current frame. 2. Call to step back one frame in the call stack. After each step, the new frame becomes the current frame, and the client may call to obtain values from the reconstructed context for the new frame. This step can be repeated until the process reaches the bottom of the stack or a signal context frame. 3. When a signal context frame is reached, the client may call to provide a new starting point for unwinding based on the context at the point of interruption. The stack frame for the function interrupted by the signal becomes the current frame. Subsequent calls to will proceed from there. Cross-Unwinding To prepare for cross-unwinding, a client application must perform the following steps to create and initialize a new unwind environment: 1. Call to create a new unwind environment. The return value is a pointer to the unwind environment. 2. Call to setup the unwind environment for cross unwinding. This call also allows the client to specify the byte order (little-endian or big-endian) of the target process. 3. Call to register the client-provided callback functions. See uwx_register_callbacks(3X) for information on writing callback routines. The steps above may be performed at any time in advance of performing a stack unwind. The resulting unwind environment can then be used repeatedly. To perform a stack unwind, the client must perform the following steps: 1. Call to provide the basic initial context as a starting point for unwinding. This initial context consists of the values of ip (instruction pointer), sp (stack pointer), bsp (backing store pointer), and cfm (current frame marker). The frame described by these values becomes the current frame. If the unwind engine needs values from additional registers in the target thread's context, it will request them as needed through the callback interface. 2. Call to step back one frame in the call stack. After each step, the new frame becomes the current frame, and the client may call to obtain values from the reconstructed context for the new frame. This step can be repeated until the process reaches the bottom of the stack or a signal context frame. 3. When a signal context frame is reached, the client may call to obtain the abi and context parameters recorded in the unwind descrip- tors for the frame. This routine returns the two values in a single int as ((abi << 8) | context). It should then call again to pro- vide a new starting point for unwinding based on the context at the point of interruption. The stack frame for the function inter- rupted by the signal becomes the current frame. Subsequent calls to will proceed from there. Obtaining Information From the Current Frame's Context Registers from the current frame may be read using and The starting address of the current function may be obtained by calling Symbolic information may be obtained, if available, for the current frame's IP by calling and ERRORS
For the APIs that return pointer values, a NULL pointer indicates a memory allocation error; otherwise a pointer to an opaque object is returned. For other APIs, an integer status code is returned. These codes are listed here. Request successfully completed. hit a signal context frame. hit bottom of stack. The cached information returned by the lookup-ip callback was invalid. The "Lookup IP" callback returned an invalid key in the result vector. The register id is invalid. The unwind information block contains an invalid descriptor. The unwind engine is unable to unwind from the current frame because of an unsupported descriptor. There was an error reading a value from the memory stack. There was an error reading a register from the initial context. There was an error reading a value from the register stack backing store. There was an error reading the unwind information block. There was an error reading the unwind table. No module information was found for the current frame's IP. The "Lookup IP" callback encountered an error. No callback routines have been registered. No initial context has been supplied. The env parameter is NULL. An attempt to allocate additional memory failed. No symbolic information was found. An unwind information block was found, but it does not describe the current frame's IP. No unwind information block was found for the current frame's IP. The unwind information block is invalid -- the nesting of prologue regions is not balanced. An unidentified error was received from the uc_access(3) library. The unwind information block is invalid -- an undefined label is referenced. EXAMPLES
The following code fragment performs a stack unwind in the current thread: LIMITATIONS
The Unwind Express Library currently does not recognize X-format unwind descriptors. These are not currently used by HP compilers. AUTHOR
The Unwind Express Library was developed by Hewlett-Packard. SEE ALSO
uc_access(3), uwx_add_to_bsp(3X), uwx_find_source_info(3X), uwx_find_symbol(3X), uwx_free(3X), uwx_get_abi_context_code(3X), uwx_get_func- start(3X), uwx_get_module_info(3X), uwx_get_nat(3X), uwx_get_reg(3X), uwx_get_source_info(3X), uwx_get_sym_info(3X), uwx_init(3X), uwx_init_context(3X), uwx_register_alloc_cb(3X), uwx_register_callbacks(3X), uwx_release_symbol_cache(3X), uwx_self_do_context_frame(3X), uwx_self_free_info(3X), uwx_self_init_context(3X), uwx_self_init_info(3X), uwx_set_nofr(3X), uwx_set_remote(3X), uwx_step(3X), uwx_step_inline(3X). Integrity Systems Only uwx(3X)
All times are GMT -4. The time now is 03:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy