Search specific name in a file and fetch specific entries
Hi all,
I have 2 files, One file contain data like this
These names are mentioned in the second file(Please see attached second file) as
# Drug_Target_X_Gene_NameWhere X can be any number (1-1000)
Now the second file contain data like this where these entries (Drug_Target_X_Gene_Name) are present
#BEGIN_DRUGCARD DB0xxxx (0001- 8820)
# Drug_Target_X_Gene_Name
Description
#END_DRUGCARD DB0xxxx (0001- 8820)
So, if any entry of first file matches with second file
Drug_Target_X_Gene_Name
I want to fetch following entry in a separate file
# Description:
So, if the CHRM1 from first file is present in Drug Card 00001 of second file as # Drug_Target_X_Gene_Name
the output shuld be
It is also possible CHRM1 is present in more than one drug cards, in that case there will be two different descriptions from two different drug cards
In same way for all entries of first file I need description from drug cards of second file if these entries are present in any of the drug card of second file.
Thanks for reply. I am matching a specific entry to fetch the description heading details only for each drug card if entry will match that why I think I have to use some other commands as well
Thanks for reply. I am matching a specific entry to fetch the description heading details only for each drug card if entry will match that why I think I have to use some other commands as well
I think you have given wrong files. There is no match between those two files..
Thanks for reply. Both of the files are big. The first file contain 137 entries but the second file is very very big therefore I have part of it here.
If you can have a look on the attached second file on page 11, it is mentioned as
# Drug_Target_1_Gene_Name:
F2
these entries has to be matched with firs file and if matched I have to fetch #description , #indication and # pharmacology headings of that Drug card in which it is matched because each drug card contain moret han one
# Drug_Target_X_Gene_Name
but only once #description , #indication and # pharmacology headings .
I have already told you that, I am not able to find any relation between those two files.
And i think others too..
So its better to give some example which has relation between each other. So that it will be very helpful to understand.Please post your Input files(which are related to each other) and desired output.
It's not possible to give solution all the time by assuming everything.
Now I want to search entries in first file in the # Drug_Target_X_Gene_Name (X= 1-1000)heading (Mentioned on page 11 of second file as sample)
if it matched as here F2 is matching then it should fetch following entries
#description , #indication and # pharmacology from each Drug card
So output will be
Code:
F2 #description Lepirudin is identical to natural hirudin except for substitution of leucine for isoleucine at the N-terminal end of the molecule and the absence of a sulfate group on the tyrosine at position 63. It is produced via yeast cells.
#indication For the treatment of heparin-induced thrombocytopenia
# pharmacology Lepirudin is used to break up clots and to reduce thrombocytopenia. It binds to thrombin and prevents thrombus or clot formation. It is a highly potent, selective, and essentially irreversible inhibitor of thrombin and clot-bond thrombin. Lepirudin requires no cofactor for its anticoagulant action. Lepirudin is a recombinant form of hirudin, an endogenous anticoagulant found in medicinal leeches.
Note: Drug_Target_X_Gene_Name entries are present between drug cards and drug card starts with
Hi ,
I have a file which contains 2 days logs(here it is 24 and 25)
I want to list data only for date 25 fron the file.
please suggest me how should i get this.
file content mentioned below
17-05-24 Name Succ Fail
00:00:29 ... (5 Replies)
Hi,
I have a file with hundreds of lines. I want to search for particular lines starting with 4000, search and replace the 137-139 position characters; which will be '000', with '036'. Can all of this be done without opening a temp file and then moving that temp file to the original file name.
... (7 Replies)
Hi,
I have logfile like this..
=== 2014-02-09 15:46:59,936 INFO RequestContext - URL: '/eyisp/sc/skins/EY/images/pickers/comboBoxPicker_Over.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko': Unsupported with Accept-Encoding header
=== 2015-02-09... (8 Replies)
Hi,
I have log file which rolls out every second which is as this.
HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Hi all,
I have following sample input file which is a part of big file:
ID AINX_HUMAN Reviewed; 499 AA.
AC Q16352; B1AQK0; Q9BRC5;
DT 30-MAY-2000, integrated into UniProtKB/Swiss-Prot.
DT 23-JAN-2002, sequence version 2.
DT 28-NOV-2012, entry version 123.... (2 Replies)
Hi Guys
This time my input sample from a Big file like this
In
TTDS00002 UniProt ID P11229
TTDS00002 Name Muscarinic acetylcholine receptor M1
TTDS00002 Type of target Successful target
TTDS00002 Synonyms M1 receptor
TTDS00002 Disease Alzheimer's disease... (13 Replies)
Hi all,
I have 2 files, One file contain data like this
FHIT
CS
CHRM1
PDE3A
PDE3B
HSP90AA1
PTK2
HTR1A
ESR1
PARP1
PLA2G1B
These names are mentioned in the second file(Please see attached second file) as
# Drug_Target_X_Gene_Name:(Where X can be any number (1-1000) (1 Reply)
Hi
i have a file which have a pattern like this
Nov 10 session closed
Nov 10 Nov 9 08:14:27 EST5EDT 2010 on tty .
Nov 10 Oct 19 02:14:21 EST5EDT 2010 on pts/tk .
Nov 10 afrtetryytr
Nov 10 session closed
Nov 10 Nov 10 03:21:04 EST5EDT 2010
Dec 8 Nov 10 05:03:02 EST5EDT 2010
... (13 Replies)
Hi,
I have text file in the following strucher .
The files contain hondreds of lines.
value1;value2;value3;value4
I would like to get back the line with lowest date (values4 field).
In this case its line number 3.
groupa;Listener;1;20110120162018
groupb;Database;0;20110201122641... (4 Replies)
Hi All,
I have a file like this,(This is a sql output file)
cat query_file
200000029
12345 10001
0.2 0
I want to fetch the values 200000029,10001,0.2 .I tried using the below code but i could get... (2 Replies)