Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with BASH/AWK queries .... Post 302477394 by Fahmida on Saturday 4th of December 2010 11:08:45 PM
Old 12-05-2010
Help with BASH/AWK queries ....

Hi Everyone,

I have an input file in the following format:
score.file1.txt
HTML Code:
contig00045 length=566   numreads=19    1047    0.0
contig00055 length=524   numreads=7    793    0.0
contig00052 length=535   numreads=10    607    e-176
contig00072 length=472   numreads=46    571    e-165
contig00019 length=667   numreads=5    474    e-136
I've a second file:
data.file1.txt
HTML Code:
>contig00045 length=566   numreads=19
GGGCTGACGTGCCGCTAATACGACTCACTATAGGGAGAGCATAAAACACG
CCTCCTGAGCTGCAGCAGAAAAAGAGACTCCCCTTGAGCTTTCAGATTGA
>contig00055 length=524   numreads=7
GGGCTGACGTGGCCGCTAATACGACTCACTATAGGGAGAGGAGGGAGGAT
GCTGGAC
>contig00052 length=535   numreads=10
GGGCTGACGTGGCCGCTAATACGACTCACTATAGGGAGAGGGATGTCCAC
AGGCAGAGGGATGTCCACAGGCAGAGGGATGCCACAGGCA
>contig00072 length=472   numreads=46
TTTAGCTGCTTTCCCCCGGAGGAGATTTGAATTCCGGTGAAATCCAGGCT
TTGTTCATTTTAATAAGCGTCAGCCTGTCAGCGCTGTCAGTTGACAGGCG
>contig00019 length=667   numreads=5
TATAGGGAGAGTGGCATTCTAATAACAGGGGACGGGGGCAGAGGACTCTC
GCTGACCGTCCCATGTAAGGGTGGTGTCGGAT
This file contains a header (>contig00045 length=566 numreads=19) followed by few lines of sequence.

In the first file (score.file1.txt), for each row the fourth column is score1(1047, 793, 607,571 etc.) and 5th column is score2 (0.0, 0.0, e-176, e-165 etc.).
I would like to extract those TWO data (from data.file1.txt) based on TOP score1 and if their score2 is NOT 0.0.

For example based on the above data, my desired output is:
output.file1.txt
HTML Code:
>contig00052 length=535   numreads=10
GGGCTGACGTGGCCGCTAATACGACTCACTATAGGGAGAGGGATGTCCAC
AGGCAGAGGGATGTCCACAGGCAGAGGGATGCCACAGGCA
>contig00072 length=472   numreads=46
TTTAGCTGCTTTCCCCCGGAGGAGATTTGAATTCCGGTGAAATCCAGGCT
TTGTTCATTTTAATAAGCGTCAGCCTGTCAGCGCTGTCAGTTGACAGGCG
Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Some queries...

Guys need some advice on how to check some of the questions below? i'm running on an open VMS platform... which i am an idiot to... appreciate if anyone can give some hints or source on how to check on.. a script that is running on cron job... but doesn't run as the login user name.. 1. why... (6 Replies)
Discussion started by: 12yearold
6 Replies

2. UNIX for Advanced & Expert Users

Two small queries

Query 1 : How to check if a directory already exists? If doesn't exist then create a new one. Query 2 : I want to put following text using a single echo statement into a log file and also want to retain the formatting of the text. How it can be... (3 Replies)
Discussion started by: skyineyes
3 Replies

3. Shell Programming and Scripting

my queries

hi guys Well, i need to have a report generation script or any script which will show me all the content/information of a file when i run that script. Please help me on this isssue at the earliest.As i am little bit aware of scripting.Thanks in advance! regards ash (4 Replies)
Discussion started by: whizkidash
4 Replies

4. Homework & Coursework Questions

Queries

Any help on like where to get started on this? I'm just confused. 1. The problem statement, all variables and given/known data: Enter text here.Queries to satisfy these two report requests (use your CCI database): Retrieve all rows of active inventory where current on hands is less than... (0 Replies)
Discussion started by: lakers34kb
0 Replies

5. UNIX for Advanced & Expert Users

awk script queries

Hi, First query: I am trying to execute the below command to pull all the record whose length is not of the expected. But this is not giving the expected results. $2 is the record length passed in the script as second parameter.$filename is the filename on which the awk is executed.It is... (4 Replies)
Discussion started by: devina
4 Replies

6. Shell Programming and Scripting

Few queries regarding awk...

One of the command output is as below. -rw-r--r--+ 1 root root 75G Nov 21 16:43 /var/ovs/mount/86BXXX/running_pool/Machine1/System-sda.img -rw-r--r--+ 1 root root 75G Nov 21 16:36 /var/ovs/mount/86BXXX/running_pool/Machine2/System.img -rw-r--r--+ 1 root root 150G Sep 23 19:13... (2 Replies)
Discussion started by: pinga123
2 Replies

7. UNIX for Advanced & Expert Users

How many DNS queries

Is there any way to see how many queries come into our external DNS server? In looking at DNS providers, most of them base pricing on number of queries per month so I just wanted to see if you had any idea/way of gathering that data? A rough ballpark figure would even work. Our DNS server is... (1 Reply)
Discussion started by: raggmopp
1 Replies

8. UNIX for Dummies Questions & Answers

FTP Queries

Hi, 1) How to get exact permissions, group names for files while transferring with FTP 2) Is there any command to transfer entire directory and sub directories. Thanks (1 Reply)
Discussion started by: nag_sathi
1 Replies

9. Debian

GRUB Queries ?!

Hello, I am posting the following questions here because I need them answered by people who have actually done a lot of work in GRUB. DO NOT GIVE ME GUESS ANSWERS PLEASE. Feel free to redirect me if this is not the right place to ask these questions. Can I download GRUB separately from... (6 Replies)
Discussion started by: sreyan32
6 Replies

10. IP Networking

RDNS Queries

Hey everyone, I have a question, I've been playing around with tcpdump, and noticed my machine making numerous rdns look ups. They are displayed like: 10.80.80.141.51234 > 10.80.80.1.domain: 9950+ PTR? 223.114.55.65.in-addr.arpa. (44) My question is, if dns works based on numerical... (0 Replies)
Discussion started by: Lost in Cyberia
0 Replies
Text::WordDiff::HTML(3pm)				User Contributed Perl Documentation				 Text::WordDiff::HTML(3pm)

Name
       Text::WordDiff::HTML - XHTML formatting for Text::WordDiff

Synopsis
	   use Text::WordDiff;

	   my $diff = word_diff 'file1.txt', 'file2.txt'; { STYLE => 'HTML' };
	   my $diff = word_diff $string1,   $string2,    { STYLE => 'HTML' };
	   my $diff = word_diff *FH1,	     *FH2,	   { STYLE => 'HTML' };
	   my $diff = word_diff &reader1,   &reader2,    { STYLE => 'HTML' };
	   my $diff = word_diff @records1,  @records2,   { STYLE => 'HTML' };

	   # May also mix input types:
	   my $diff = word_diff @records1,  'file_B.txt', { STYLE => 'HTML' };

Description
       This class subclasses Text::WordDiff::Base to provide a XHTML formatting for Text::WordDiff. See Term::WordDiff for usage details. This
       class should never be used directly.

       Text::WordDiff::HTML formats word diffs for viewing in a Web browser. The diff content is highlighted as follows:

       o   "<div class="file">"

	   This element contains the entire contents of the diff "file" returned by "word_diff()". All of the following elements are subsumed by
	   this one.

	   o   "<span class="fileheader">"

	       The header section for the files being "diff"ed, usually something like:

		 --- in.txt    Thu Sep	1 12:51:03 2005
		 +++ out.txt   Thu Sep	1 12:52:12 2005

	       This element immediately follows the opening "file" "<div>" element, but will not be present if Text::WordDif cannot deterimine the
	       file names for both files being compared.

	   o   "<span class="hunk">"

	       This element contains a single diff "hunk". Each hunk may contain the following elements:

	       o   "<ins>"

		   Inserted content.

	       o   "<del>"

		   Deleted content.

       You may do whatever you like with these elements and classes; I highly recommend that you style them using CSS. You'll find an example CSS
       file in the eg directory in the Text-WordDiff distribution.

See Also
       Text::WordDiff
       Text::WordDiff::ANSIColor

Support
       This module is stored in an open repository at the following address:

       <https://svn.kineticode.com/Text-WordDiff/trunk/>

       Patches against Text::WordDiff are welcome. Please send bug reports to <bug-text-worddiff@rt.cpan.org>.

Author
       David Wheeler <david@kineticode.com>

Copyright and License
       Copyright (c) 2005-2008 David Wheeler. Some Rights Reserved.

       This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

perl v5.10.0							    2009-09-24						 Text::WordDiff::HTML(3pm)
All times are GMT -4. The time now is 06:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy