Sponsored Content
Top Forums Shell Programming and Scripting Replace other instances except the first one Post 302708475 by jacobs.smith on Monday 1st of October 2012 03:34:14 PM
Old 10-01-2012
Replace other instances except the first one

Hi Friends,

This is my input

Code:
track type=alpha name="omega"
fixedStep chrom=chr10 name="omega"
1
2
3
34
4
4
44
4
4
34
5
5
566
6
66
77
7
7
track type=alpha name="omega"
fixedStep chrom=chr11 name="omega"
9
8
7
9
8
98789
1256
565
876
0
0
0
0
00
97856412
36
65
548
track type=alpha name="omega"
fixedStep chrom=chr12 name="omega"
1212123
5456
8789
4554


Now, my output should be

Code:
track type=alpha name="omega"
fixedStep chrom=chr10 name="omega"
1
2
3
34
4
4
44
4
4
34
5
5
566
6
66
77
7
7
fixedStep chrom=chr11 name="omega"
9
8
7
9
8
98789
1256
565
876
0
0
0
0
00
97856412
36
65
548
fixedStep chrom=chr12 name="omega"
1212123
5456
8789
4554

Basically, leave the first
Quote:
track type=
section. But, replace all other instances of it.

Any thoughts are highly appreciated.

A small hint is that each next line after the
Quote:
track type=
line starts with
Quote:
fixed
.

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

multiple instances of syslogd - is it possible?

I would like to start up multiple instances of syslog daemon. I am having a little difficulty. Is this at all possible? I have separate syslog.conf1.... syslog.conf5 files. I have linked the daemon to separate files syslogd1 ... syslogd5 I have arranged the rcd.2 start/stop scripts for... (9 Replies)
Discussion started by: Gary Dunn
9 Replies

2. UNIX for Dummies Questions & Answers

Multiple file instances

I am capturing text based reports with a specific program, which works no problem. However, since I send report warehouse output as they are migrated from the database software, on occasion when two capture process' initiate simultaneously, the capture file locks up. Is there a way to setup (in... (1 Reply)
Discussion started by: gozer13
1 Replies

3. Shell Programming and Scripting

detecting multiple instances

Hi Gurus I have a requirement like this. i use solaris OS.. if there are 2 instances of the same ksh file running in the directory, i need to kill the ksh file that started to run latest. suppose ragha.ksh starts running thru cron in abc/xyz directory now ragha.ksh started running by any... (3 Replies)
Discussion started by: ragha81
3 Replies

4. Shell Programming and Scripting

How to replace all string instances found by find+grep

Hello all Im performing find + grep operation that looks like this : find . -name "*.dsp" | xargs grep -on Project.lib | grep -v ':0' and I like to add to this one liner the possibility to replace the string " Project.lib" that found ( more then once in file ) with "Example.lib" how can I do... (0 Replies)
Discussion started by: umen
0 Replies

5. Shell Programming and Scripting

Multiple instances of a job.

Could you please let me know how to create/make a multiple instances of a job/process in ksh(shell scripting). i.e., at present the parent script is calling another child/dependent script for only once. What we want is, the parent script itself has to execute multiple times, and in each one it... (1 Reply)
Discussion started by: Gangegowda
1 Replies

6. Shell Programming and Scripting

Can sed replace every 2 instances it finds in a file? Pattern.

My goal is to make a script to find/replace the variable "PORT" with a unique number. Like the following <VirtualHost 174.120.36.236:PORT> ServerName architect.com.ph ServerAlias www.architect.com.ph DocumentRoot /home/architec/public_html ServerAdmin... (16 Replies)
Discussion started by: EXT3FSCK
16 Replies

7. Shell Programming and Scripting

Filtering rows for first two instances of a value

Kindly help me with this problem: My data looks like this: SNPfile.txt CHR_A BP_A SNP_A CHR_B BP_B SNP_B R2 p-SNP_A p-SNP_B 4 172575323 rs17056855 4 172601079 rs11945883 0.119414 0.049972656 0.031050345 4 172575323 rs17056855 4 ... (2 Replies)
Discussion started by: genehunter
2 Replies

8. Shell Programming and Scripting

replacing all instances in a file

Hi I have some script like this: perl -i -p0e 's/"keyword1-.*?"/"keyword2"/s' file to replace some keyword, but it replaces only the first instance of the keyword how can i get it to replace all instances? thanks! (2 Replies)
Discussion started by: vanessafan99
2 Replies

9. UNIX for Dummies Questions & Answers

print all instances of sshd

how would i print all the instance of sshd process, sorted based on alphabetical order of user-id. the output should only consist of User-ID of the process and the process name? (1 Reply)
Discussion started by: stefanere2k9
1 Replies

10. Programming

Multiple instances of pthread

Suppose I declare pthread_t clear_thread; and then pthread_create(&clear_thread, &detach, clear_message, this); the thread is supposed to go away, perform the service it is intended to procide, and then kill itself. A little while later, I require this service again, so I say ... (2 Replies)
Discussion started by: clerew
2 Replies
ovp2ovf(1)                                                             Omega                                                            ovp2ovf(1)

NAME
ovp2ovf - convert a virtual property-list file into a virtual font file and its associated font metric file SYNOPSIS
ovp2ovf [OPTIONS] OVPFILE[.ovp] [OVFFILE[.ovf] [OFMFILE[.ofm]]] DESCRIPTION
ovp2ovf translates a human-readable virtual property list (OVP) file, OVPFILE, into a virtual font (OVF) file, OVFFILE and its companion font metric (OFM) file, OFMFILE. The program also works with TeX VP files, producing VF and TFM files. (ovp2ovf is based on the WEB source code for vptovf(1).) OPTIONS
-help display a brief summary of syntax and options -verbose display progress reports -version output version information and exit FILES
OFMFILE Omega Font Metric file OVFFILE Omega Virtual Font file OVPFILE Omega Virtual Property List file BUGS
None known, but report any found to <omega@ens.fr> (mailing list). You should also check to see if the bug is in vptovf(1). SEE ALSO
omega(1), ofm2opl(1), ovf2ovp(1), pltotf(1), tftopl(1), vftovp(1), vptovf(1) Draft Manual for the Omega System (omega-manual.dvi). Web page: <http://www.gutenberg.eu.org/omega/> AUTHOR
According to the WEB documentation: VPtoVF is an extended version of the program PLtoTF, which is part of the standard TeXware library. OVP2OVF is an extended version of VPtoVF that allows much larger fonts. The idea of a virtual font was inspired by the work of David R. Fuchs who designed a simi- lar set of conventions in 1984 while developing a device driver for ArborText, Inc. He wrote a somewhat similar program called PLFONT. The primary authors of Omega are John Plaice <plaice@cse.unsw.edu.au> and Yannis Haralambous <yannis@fluxus-virus.com>. This manual page was written by C.M. Connelly <cmc@debian.org>, for the Debian GNU/Linux system. It may be used by other distributions without contacting the author. Any mistakes or omissions in the manual page are my fault; inquiries about or corrections to this manual page should be directed to me (and not to the primary author). Omega September 2000 ovp2ovf(1)
All times are GMT -4. The time now is 10:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy