Program to match the id and replace one letter in the content
Hi all,
I have one file with a sequence and the other file which says the position and the letter to be changed. I have to match two files and replace content. Example is shown which will describe what I want to do. For example, file 1 has many sequences and few are shown below
sequence file:
and the second file has the id which is enclosed in between || in the first file and the letters to be changed. Now I have to match the id column with the header line in the seuqence file |P78363|. if they are same, do the change as mentioned and write in the output file.
the output file should contain the sequences of the changed letters and the change name in the header as highlighted (bold) in the below code
Could anyone please help with a script which can do this. It will be bery helpful
Note: this is not a school exercise.
Hi,
Long list of Input file1 content:
1285_t
4860_i
4817_v
8288_c
9626_a
.
.
.
Long list of Input file2 content:
1285_t chris germany
8288_c steve england
9626_a dave swiss
9260_s stephanie denmark
.
.
. (14 Replies)
Hi,
im able to search for string in a file (ex: grep -w "$a" input.txt). but i have to search for the uppercase of a string in a file where upper case of the file content matches something like below.
where upper("$a")== converted to upper case string in (input.txt)
can someone please provide... (5 Replies)
Good afternoon all,
I want to ask how to change some letter in my file with other letter in spesific line
eg.
data.txt
1
1
1
0
0
0
0
for example i want to change the 4th line with character 1.
How could I do it by SED or AWK.
I have tried to run this code but actually did not... (3 Replies)
Hi,
I need to replace, as the title says, the first letter of each line (when it's not a number) by the same letter, but capital.
For instance :
hello
Who
123pass
Would become :
Hello
Who
123pass
Is there a way with sed to do that ? Or other unix command ?
Thank you :) (7 Replies)
I have a pbd file, which has the following format:
TITLE Protein X
MODEL 1
ATOM 1 N PRO 24 45.220 71.410 43.810 1.00 0.00
ATOM 2 H1 PRO 24 45.800 71.310 42.000 1.00 0.00
TER
ENDMDL
Column 22 is the chain... (5 Replies)
AWK command to get file content until 3 occurrence of pattern match,
INPUT FILE:
JMS_BODY_FIELD:JMSText = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<custOptIn xmlns="http://com/walm/ta/cu/ccs/xml2">
<person>Romi</person>
<appName>SAP</appName>
</custOptIn>
... (4 Replies)
Discussion started by: prince1987
4 Replies
LEARN ABOUT OPENSOLARIS
replace
replace(1) MySQL database replace(1)NAME
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place
in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.
USAGE
replace [-?svIV] from to from to ... -- [files]
or
replace [-?svIV] from to from to ... < fromfile > tofile
SYNOPSIS
replace [-?|-I] [-s] [-v]
DESCRIPTION
replace
-?|-I info
-s silent
-v verbose
EXTRA INFO
Special characters in from string:
^ Match start of line.
$ Match end of line.
Match space-character, start of line or end of line. For a end the next replace starts locking at the end space-character. A
alone in a string matches only a space-character.
EXAMPLE
this command swaps a and b in the given files:
shell> replace a b b a -- file1 file2 ...
SEE ALSO isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi-
lege_tables(1), mysqlshow(1), mysql_zap(1), perror(1),
For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online
at http://www.mysql.com/doc/en/
BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
AUTHOR
Ver 1.0, distribution 4.0.24 Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no
warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercur-
media.com)
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+------------------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+------------------------------------+
|Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt |
+--------------------+------------------------------------+
|Interface Stability | External |
+--------------------+------------------------------------+
NOTES
Source for mysql is available on http://opensolaris.org.
MySQL 4.0 19 December 2000 replace(1)