script to find non overlapping positions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to find non overlapping positions
# 1  
Old 12-03-2008
script to find non overlapping positions

Hi,

I am a newbie in unix programming so maybe this is a simple question.
I would like to know how can I make a script that outputs only the values that are not between any given start and end positions

Example

file1:
2 30
40 80
82 100

file2:
ID1 1
ID2 35
ID3 80
ID4 81
ID6 160

So, I would like to save to a file the lines from file2 where the numbers from the 2nd column are not between the start and end positions of file1. Therefore, the desired output would be:

Desired output file:
ID4 81
ID6 160

Thanks in advance.
Image
# 2  
Old 12-03-2008
Double Posted.

Double post message -- closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find flanking positions

I have a positions file with markers in col1 and position defined by chromosome and location in col2 and col3 m1 ch1 1 m2 ch1 5 m3 ch1 50 m4 ch2 567 m5 ch2 4567 m6 ch2 7766 m7 ch2 554433 m8 ch3 76 m9 ch3 456 m10 ch3 2315 Given a set of query marker, I would like to know what are the... (1 Reply)
Discussion started by: jianp83
1 Replies

2. Shell Programming and Scripting

Identify the overlapping and non overlapping regions

file1 chr pos1 pos2 pos3 pos4 1)chr1 1000 2000 3000 4000 2)chr1 1380 1480 6800 7800 3)chr1 6700 7700 1200 2200 4)chr2 8500 9500 5670 6670 file2 chr pos1 pos2 pos3 pos4 1)chr2 8500 9500 5000 6000 2)chr1 6700 7700 1200 2200 3)chr1 1380 1480 6700 7700 4)chr1 1000 2000 4900 5900 I... (2 Replies)
Discussion started by: data_miner
2 Replies

3. Shell Programming and Scripting

Assigning the names from overlapping regions

I have 2 files; file 1 having smaller positions that overlap with the positions with positions in file2. file1 aaa 20 22 apple aaa 18 25 banana aaa 12 30 grapes aaa 22 25 melon file2 aaa 18 26 cdded aaa 10 35 abcde I want to get something like this output aaa 18 26 cdded banana... (4 Replies)
Discussion started by: anurupa777
4 Replies

4. IP Networking

Test for overlapping IP ranges

Greetings folks, I have a rather lengthy list of banned IP ranges in iptables. Initially it was constructed as a rather ad-hoc affair, then later I discovered a site which had IP Block By Country lists, and imported several into iptables. If possible, I'd like to be able to verify if the list... (0 Replies)
Discussion started by: putter1900
0 Replies

5. Solaris

shared memory overlapping

hey guys, i'm having trouble with a real time multi threaded program that uses lots of shared memory on solaris 8. it sometime crashes out of the blue, a randomness that suggests some sort of memory leak or shared memory overlap. any tips? freeware or otherwise useful software? any way i can... (2 Replies)
Discussion started by: princeofnothing
2 Replies

6. Programming

Overlapping pictureboxes?

I am making a game, but I can't figure out how to put one image over the other. The background of the front image, covers up the picturebox under it. For example, I have two fish images, but when one is in front of the other, its background covers up the other fish. I attached a picture as an... (1 Reply)
Discussion started by: romeo5577
1 Replies

7. UNIX for Dummies Questions & Answers

find positions of a letter in a text file

Hi, I would like to know how can I get all the positions of a letter, let say letter C in a text file. sample input file: hcck pgog hlhhc desired output file: 2 3 13 Many thanks! (2 Replies)
Discussion started by: fadista
2 Replies

8. Shell Programming and Scripting

awk script replace positions if certain positions equal prescribed value

I am attempting to replace positions 44-46 with YYY if positions 48-50 = XXX. awk -F "" '{if (substr($0,48,3)=="XXX") $44="YYY"}1' OFS="" $filename > $tempfile But this is not working, 44-46 is still spaces in my tempfile instead of YYY. Any suggestions would be greatly appreciated. (9 Replies)
Discussion started by: halplessProblem
9 Replies

9. UNIX Desktop Questions & Answers

non-overlapping terminals

Hi Everyone! I was wondering if there's an easy way to have terminals (gnome-terminal for instance) be open in such a way that they're not overlapping each other? I suppose I could play around with the --geometry option but that would imply me checking whether a terminal is already at a given... (3 Replies)
Discussion started by: anthalamus
3 Replies
Login or Register to Ask a Question