Quote:
Originally Posted by
bioinfo
Hi,
I have two files:
ENDMDL is coming many times in 11.txt. I wish to retreive that pattern corresponds to the value of Id. It means, if I give input of 004 (Id) from group 2, then it should output the fourth repeat from 11. txt ending with ENDMDL.
So, corresponding to value of Id from c.txt, I want to retreive the repeat at the number from 11.txt.
Please guide, how, corresponding to value of Id from c.txt, I can retreive the repeat at the number from 11.txt.
Also, I wish to retreive these patterns in individual files based on their Id, group, centre. For example:
group0.txt contains all patterns with Id
group1.txt contains all patterns with Id
group2.txt contains all patterns with Id
One file containing patterns with corresponding to centre ID
Id001.txt
Id002.txt
Id009.txt
............
............
Thanks
This is the third or fourth problem you have posted to this thread. Reading through the thread it is getting hard to determine which problem is being addressed by some of the comments.
I have shown you how to read
11.txt, accumulate the entries in it for each set of lines ending with an ENDMDL line, and print selected entries from the accumulated list. You know what files you want to create and what you want in them, so why don't you try putting together an awk script to do that and let us know what isn't working.
From your description of groups, centres, and IDs, I have no idea how many files you want created nor what is supposed to be in each of them. I also don't see any use for the lines starting with
Centre: in your
c.txt file; they just have the characters
Centre: followed by the Id of the last Branch in the Group that they follow, followed by the characters
Nodes: , followed by the number of branches listed on the preceding
Group: line. What is the difference between a Node and a Branch? What is the difference between a Group and a Centre?
If you can't do this awk script yourself, you're going to have to give us a lot more detail specifying the exact list of the files you want produced in response to the snippet from
c.txt you provided, along with the data that you want written into those files.