Hi Dave:
Thanks for your comments! Actually I prefer your style too, e.g. use warnings etc. I scripted another codes as:
I used the first column $AAA[0] of file1 as key of the hash, and then compare with the first column $BBB[0] of file2. If $AAA[0] contains the string $BBB[0], it means a match, as "mira_" is not the only assembly marker.
It seems running except a small bug for
which caused the warning and stopped the program. So that I have to comment the use warnings.
The code takes ~6 hours for my 2.3Ghz dual CPU + 3GB RAM (compaq machine) to run. Not sure if this could be improved for file1 has 147478 rows (15.2MB) and file2 86837 rows(7.2MB).
Actually I have another idea in my mind to reduce the work load because the iteration is 147478x86837 times. If a match is found in file1, then the matched row in file1 can be deleted so that for the next $BBB[0] in file2 does not need to search this row again. ... so that the last search is 86838 instead of 147478 loops ( when the match is in the last row, worst scenario!). The reason is each row is unique in both file. Could not figure out this by myself. Any clue is highly appreciated!
Yifang
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
I have n files (for ex:64 files) with one similar column. Is it possible to combine them all based on that column ?
file1
ax100 20 30 40
ax200 22 33 44
file2
ax100 10 20 40
ax200 12 13 44
file2
ax100 0 0 4
ax200 2 3 4 (9 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
I'm dealing with an issue and losing a lot of hours figuring out how i would solve this.
I have an input file which looks like this:
('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos')
('BLABLA +200-GRR','Serviço... (6 Replies)
Hi,
I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt. Each file has 3 columns (2 other columns in addition to the first common column).
I want to write a script to join the files by the first common column so that in the... (5 Replies)
Hi all,
I'm trying to join two .txt file tab delimitated based on a common column.
File 1
transcript_id gene_id length effective_length expected_count TPM FPKM IsoPct
comp1000201_c0_seq1 comp1000201_c0 337 183.51 0.00 0.00 0.00 0.00
comp1000297_c0_seq1 ... (1 Reply)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Hello,
This post is already here but want to do this with another way
Merge multiples files with multiples duplicates keys by filling "NULL" the void columns for anothers joinning files
file1.csv:
1|abc
1|def
2|ghi
2|jkl
3|mno
3|pqr
file2.csv:
1|123|jojo
1|NULL|bibi... (2 Replies)
Discussion started by: yjacknewton
2 Replies
LEARN ABOUT SUSE
git-merge-base
GIT-MERGE-BASE(1) Git Manual GIT-MERGE-BASE(1)NAME
git-merge-base - Find as good common ancestors as possible for a merge
SYNOPSIS
git merge-base [-a|--all] <commit> <commit>...
DESCRIPTION
git merge-base finds best common ancestor(s) between two commits to use in a three-way merge. One common ancestor is better than another
common ancestor if the latter is an ancestor of the former. A common ancestor that does not have any better common ancestor is a best
common ancestor, i.e. a merge base. Note that there can be more than one merge base for a pair of commits.
Among the two commits to compute the merge base from, one is specified by the first commit argument on the command line; the other commit
is a (possibly hypothetical) commit that is a merge across all the remaining commits on the command line. As the most common special case,
specifying only two commits on the command line means computing the merge base between the given two commits.
As a consequence, the merge base is not necessarily contained in each of the commit arguments if more than two commits are specified. This
is different from git-show-branch(1) when used with the --merge-base option.
OPTIONS -a, --all
Output all merge bases for the commits, instead of just one.
DISCUSSION
Given two commits A and B, git merge-base A B will output a commit which is reachable from both A and B through the parent relationship.
For example, with this topology:
o---o---o---B
/
---o---1---o---o---o---A
the merge base between A and B is 1.
Given three commits A, B and C, git merge-base A B C will compute the merge base between A and a hypothetical commit M, which is a merge
between B and C. For example, with this topology:
o---o---o---o---C
/
/ o---o---o---B
/ /
---2---1---o---o---o---A
the result of git merge-base A B C is 1. This is because the equivalent topology with a merge commit M between B and C is:
o---o---o---o---o
/
/ o---o---o---o---M
/ /
---2---1---o---o---o---A
and the result of git merge-base A M is 1. Commit 2 is also a common ancestor between A and M, but 1 is a better common ancestor, because 2
is an ancestor of 1. Hence, 2 is not a merge base.
When the history involves criss-cross merges, there can be more than one best common ancestor for two commits. For example, with this
topology:
---1---o---A
/
X
/
---2---o---o---B
both 1 and 2 are merge-bases of A and B. Neither one is better than the other (both are best merge bases). When the --all option is not
given, it is unspecified which best one is output.
AUTHOR
Written by Linus Torvalds <torvalds@osdl.org[1]>
DOCUMENTATION
Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org[2]>.
GIT
Part of the git(1) suite
NOTES
1. torvalds@osdl.org
mailto:torvalds@osdl.org
2. git@vger.kernel.org
mailto:git@vger.kernel.org
Git 1.7.1 07/05/2010 GIT-MERGE-BASE(1)