How to extract specific information?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to extract specific information?
# 1  
Old 08-25-2014
How to extract specific information?

hi, i have a file A like this:

Code:
******************* No 2823 ********************
contig15205-
                    G383C4U02H4G80+ is in contig15205-
                    G383C4U02HGLXM- is in contig15205-
                    G383C4U01C3HIZ+ is in contig15205-
                    G383C4U02HDLAB+ is in contig15205-
                    G383C4U01DVIXN+ is in contig15205-
                    G383C4U01AT850+ is in contig15205-
                    G383C4U01AVD5W- is in contig15205-
                    G383C4U02JAADO- is in contig15205-
                    G383C4U01ETXWQ+ is in contig15205-
                    G383C4U02GH68R- is in contig15205-
                    G383C4U01A59A3- is in G383C4U02GH68R-
                    G383C4U02HQGV3+ is in contig15205-
                    G383C4U01BJG92- is in contig15205-
                    G383C4U02JP8KO+ is in contig15205-
                    G383C4U02HZI67- is in contig15205-
******************* Con 2824 ********************
contig15207-
                    G383C4U01DJJKO+ is in contig15207-
                    G24KUME16J2AZZ+ is in contig15207-
                    G383C4U02HECZI- is in contig15207-
                    G383C4U02F2S43+ is in contig15207-
G383C4U01AQEWM+
******************* Single 2825 ********************
contig15209+
                    G383C4U01E15DK+ is in contig15209+
                    G383C4U02FZUMZ- is in contig15209+
                    G383C4U01EMTPI- is in contig15209+
                    G383C4U01C3ZHB- is in contig15209+
                    G383C4U02I7359+ is in contig15209+
                    G383C4U01AEZA8+ is in contig15209+
******************* Contig 2826 ********************
contig15210+

......

And i have a file B containing the key ids i want, like this:
Code:
No 2823
Con 2824

How can i a get a file contain only the detailed information for each key id of interest?
# 2  
Old 08-25-2014
Is this a homework assignment?

What have you tried?

Are keys always two "words" where the 1st word is alphabetic and the second word is numeric?

Can a key given in file B appear more than once in file A?

Please show us the output your are hoping to get.
# 3  
Old 08-26-2014
hi, this is not a homework. This is related to my bioinformatics research. I do not know how to programming.

The key in B file appear twice in file A.


Quote:
Originally Posted by Don Cragun
Is this a homework assignment?

What have you tried?

Are keys always two "words" where the 1st word is alphabetic and the second word is numeric?

Can a key given in file B appear more than once in file A?

Please show us the output your are hoping to get.
# 4  
Old 08-26-2014
This site is not a place where you can get volunteers to act as your unpaid programming staff! We are here to help you learn how to write your own programs...

I repeat:
What have you tried?

Are keys always two "words" where the 1st word is alphabetic and the second word is numeric?

Please show us the output your are hoping to get from the sample input you provided.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract information from file

In a particular directory, there can be 1000 files like below. filename is job901.ksh #!/bin/ksh cront -x << EOJ submit file=$PRODPATH/scripts/genReport.sh maxdelay=30 &node=xnode01 tname=job901 &pfile1=/prod/mldata/data/test1.dat ... (17 Replies)
Discussion started by: vedanta
17 Replies

2. Shell Programming and Scripting

Extract information from file

Gents, If is possible please help. I have a big file (example attached) which contends exactly same value in column, but from column 2 to 6 these values are diff. I will like to compile for all records all columns like the example attached in .csv format (output.rar ).. The last column in the... (11 Replies)
Discussion started by: jiam912
11 Replies

3. Shell Programming and Scripting

Extract Specific Information from a particular field

Hi, I am trying to extract a specific information from a file which contains more than 200 million records. Attached the input file for your reference. My file contains information below ... (4 Replies)
Discussion started by: rramkrishnas
4 Replies

4. Shell Programming and Scripting

Help with shell script to extract certain information

Hi, I have a file which I need to programmatically split into two files. All the information in the file before pattern "STOP HERE" is to be stripped and output into one file while everything after "STOP HERE" is to be output into a separate file. I would appreciate help on how to do... (8 Replies)
Discussion started by: PTL
8 Replies

5. Shell Programming and Scripting

How to extract information from a file?

Hi, i have a file like this: <Iteration> <Iteration_iter-num>3</Iteration_iter-num> <Iteration_query-ID>lcl|3_0</Iteration_query-ID> <Iteration_query-def>G383C4U01EQA0A length=197</Iteration_query-def> <Iteration_query-len>197</Iteration_query-len> ... (9 Replies)
Discussion started by: the_simpsons
9 Replies

6. Shell Programming and Scripting

Extract information into large variable

Hello people :) That's here my first message to your forum, so I guess it would be fine ^^ I have a request about a code I want to use. Actually, my system use a large variable, including much informations but those informations can change by more and I want to extract one of thoses... (26 Replies)
Discussion started by: WolwX
26 Replies

7. Shell Programming and Scripting

Extract various information from a log file

Hye ShamRock If you can help me with this difficult task for me then it will save my day Logs : ================================================================================================================== ... (4 Replies)
Discussion started by: SilvesterJ
4 Replies

8. Shell Programming and Scripting

Using txr to extract information from output

am using txr command (txr 1097) on a process that generates the following output. Im trying to extract the 13th field from the highlighted string. it is delimited by '?'. The 13th field corresponds to the '0' (in bold). can you let me know how I can extract the 13 th field please? ... (1 Reply)
Discussion started by: pazman
1 Replies

9. Shell Programming and Scripting

AWK to extract information

Hi all, I am working on a shell script to extract information from a file that has output from Oracle sqlplus. The problem is that the output of a single line is spread across multiple lines and i do not know as how to extract the particular filed at ones,which spans multiple lines.... (2 Replies)
Discussion started by: harris2107
2 Replies

10. Shell Programming and Scripting

How do you extract the information from a library?

hi all, i am quite new with Perl (just 1 week of experience) and i am suppose to understand the usage of library, which i can't, anyway... i came across this library...i think from the linux redhat redhat.linux.lib.pl, there are a couple of functions there that can be used to retrieve information... (3 Replies)
Discussion started by: mercz
3 Replies
Login or Register to Ask a Question