Sponsored Content
Top Forums Shell Programming and Scripting Find common numbers and print yes or no Post 302704045 by manigrover on Thursday 20th of September 2012 11:44:13 PM
Old 09-21-2012
Find common numbers and print yes or no

Hi

I have 2 files with following data

First file,

Code:
 sp|Q676U5|A16L1_HUMAN, 
    Autophagy-related protein 16-1 OS=Homo sapiens GN=ATG16L1 PE=1 SV=2,
  Maximum coiled-coil residue probability: 0.657 in position 163.
  Maximum dimeric residue probability:     0.288 in position 163.
  Maximum trimeric residue probability:    0.369 in position 163.
Coil    0.63@  91- 118:c,3    0.60@ 154- 190:c,3

Second file

Code:
AC   Q676U5; A3EXK9; A3EXL0; B6ZDH0; Q6IPN1; Q6UXW4; Q6ZVZ5; Q8NCY2;
AC   Q96JV5; Q9H619;
FT   COILED       78    230       Potential.
FT   VARIANT     300    300       T -> A (associated with susceptibility to
FT   VARIANT     307    307       E -> K (in dbSNP:rs1866878).


If number afte sp in first file "Q676U5" matches with the first number after AC in second file "Q676U5"

it should check for second file

"variant" and the number after this if lies within
the numeric range mentioned in first file after

@ 91- 118 @ 154- 190

then expected output should be accordingly that

Code:
Q676U5 : No

because number after variant in second file 300 and 307 do not lie in the range of @ 91- 118 @ 154- 190

so expected output is No after the matched first number.

In the same way we can match entries with other number and put the yes or no if the number after variant in second file lies in range afte@in fist files.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Get un common numbers from two files

Hi, I have two files: abc : 50040 123123 31703 cde: 104 97 50040 123123 31703 36609 50534 (3 Replies)
Discussion started by: jingi1234
3 Replies

2. Shell Programming and Scripting

Perl ? - How to find and print the lowest and highest numbers punched in by the user?

. . . . . . (3 Replies)
Discussion started by: some124one
3 Replies

3. Shell Programming and Scripting

Unix help to find blank lines in a file and print numbers on that line

Hi, I would like to know how to solve one of my problems using expert unix commands. I have a file with occasional blank lines; for example; dertu frthu fghtu frtty frtgy frgtui frgtu ghrye frhutp frjuf I need to edit the file so that the file looks like this; (10 Replies)
Discussion started by: Lucky Ali
10 Replies

4. Shell Programming and Scripting

finding common numbers (contents) across 2 or 3 files

I have 3 files which are tab delimited and have numbers in it. file 1 1 2 3 4 5 6 7 File 2 3 5 7 8 File 3 1 (4 Replies)
Discussion started by: Lucky Ali
4 Replies

5. UNIX for Dummies Questions & Answers

Print numbers and associated text belonging to an interval of numbers

##### (0 Replies)
Discussion started by: lucasvs
0 Replies

6. Homework & Coursework Questions

program to find and print a Fibonacci sequence of numbers. --Errors

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am trying to convert a C language program over to Sparc Assembley and I am getting Undefined first referenced... (4 Replies)
Discussion started by: kenjiro310
4 Replies

7. UNIX for Dummies Questions & Answers

Find common numbers from two very large files using awk or the like

I've got two files that each contain a 16-digit number in positions 1-16. The first file has 63,120 entries all sorted numerically. The second file has 142,479 entries, also sorted numerically. I want to read through each file and output the entries that appear in both. So far I've had no... (13 Replies)
Discussion started by: Scottie1954
13 Replies

8. UNIX for Dummies Questions & Answers

Print events from two lines with a common identifier

Hi Unix Gurus, I have a long text file, where alarms events are logged and alarm clear event are logged. Both events alarm and alarm clear has common identifier as{xxxxxxxxxx} I need to analyse the time-period for which the alarm sustained. i.e Output: timestamp from both event has... (3 Replies)
Discussion started by: vanand420
3 Replies

9. Shell Programming and Scripting

Find Special/Null/Control Chars and Print Line Numbers

Hi All, This might be a basic question... I need to write a script to find all/any Speacial/Null/Control Chars and Print Line Numbers from an input file. Output something like Null Characters in File Name at : Line Numbers Line = Print the line Control Characters in File Name at : Line... (2 Replies)
Discussion started by: Kevin Tivoli
2 Replies
ppmtosixel(1)                                                 General Commands Manual                                                ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 03:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy