473,395 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

perl merging data

89
Hi I need to merge my data as below and its highly confusing and please let me know how to do.

Expand|Select|Wrap|Line Numbers
  1. 3       131835844       131835943       3       131830073       131830172
  2. 18      33659786        33659885        18      33653576        33653675
  3. 2       146593375       146593474       2       146578884       146578983
  4. 3       83938058        83938157        3       83935615        83935714
  5. 4       46493910        46494009        4       46491549        46491648
  6. 6       66318803        66318902        6       66316635        66316734
  7. 7       157824010       157824109       7       157822909       157823008
  8. 21      46629155        46629254        21      46626285        46626384
  9. 1       244751925       244752024       1       244749678       244749777
  10.  
  11.  
I have to merge my data of every line as below:
For every line,
If ($col1Line1 eq $col4Line2) {

if($col2Line2 lies between $col2Line1 and $col3Line1 or ($col3Line2 lies between $col2Line1 and $col3Line1) && ($col5Line2 lies between $col5Line1 and $col6Line1 or ($col5Line2 lies between $col5Line1 and $col6Line1) {
$merge line 1 and 2 and make it as a line with outer most $col2, $col3, $col5 and $col6
}

}

Basically I want to merge data into clusters with overlapping from both the ends. The comparison needs to be done against all the records and merge them into bigger clusters.

If I write a very biginners way of writing the above conditions, it might take a longer time to finish the job too. It would be really really great if someone could help in this? Thanks.
Nov 18 '10 #1
0 1103

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jon Bosker | last post by:
Help! This is probably easy but I just don't get it. I am trying to relate and merge 2 datasets. My XML file has 2 datasets (1st level nodes) TimeDetail and TimeSummary. The report is supposed to...
0
by: Mike | last post by:
Hi! I have 2 datasets loaded with data from two xml files having the same schema. The files contain data from yesterday and today. I'd like to merge both datasets in such a way that the resulting...
0
by: vins | last post by:
Hi everyone, I m new to this community and hopes that some kind folks will guide me along. Well I have a client who wants to merging some data from different websites. For example, 2 different...
4
by: Winger | last post by:
Hi, I'm having a weird problem... Part of code first: Dim bytes(tcpClient.ReceiveBufferSize) As Byte Dim DataChunk as String Dim FullData as String Do While EOF = False If...
2
by: simone | last post by:
I have an output file, say OUT.TXT generated using VB6 code. I also have an input data file say IN.TXT stored on my computer and I need to copy data from some of the columns tn the file IN to the...
3
by: Ralph Smith | last post by:
I have two identical databases on two different servers and I need to add the data in tables from one server to the tables in the other server. Is there a way to do that in mysql? thanks, Ralph
1
by: Megi | last post by:
welcome, I input data form file to mysql with command: load data local infile.. The efect is that the data are duplicated or trippled..etc with every re-loading the script, but I need to load...
9
by: karenjfrancis | last post by:
I have 4 Access databases, all with the same data model but different data. I want to build a front end that brings all of the data in the 4 databases together into one. Assuming my table of...
1
by: srinivasan srinivas | last post by:
Thanks, Srini Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/
5
by: lilly07 | last post by:
Hi, I have a doubt regarding perl hash data. I have a tab delimited as below: file1.txt name1 AM bin1 name2 AM bin1 name3 PM bin1
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.