Hi Ikki!
Thanks for your reply! I use awk bacause I'm more familiar with its sintax, i've just used sed a couple of time!
My files contain datas from genetic chips, and each file belongs to a person.
Each file has ~360000 lines.
You're right, I have more than one file shorter than the other..at the moment there are 95 shorter files. But they could increase, and yes, in shorter files it's possible that a line starting with cnvi0000004 is followed by a line starting with cnvi0000006 or cnvi0000008...it depends on how many records are missing for this person, but all input file are sorted by the first column.
As I said I've written an R-script that works, but it is extremely slow. In this script I compare a list of "complete" names with another and see if there are differences. Once i found elements that aren't in the short list, i add them in this list in order to have elements with same length. In this way I can merge all column and insert tabs instead of missing datas. I post the R-code:
Now I'm trying to port this in a shell script to have a faster response. My purpose was to avoid files preprocessing if i can, because of the large amount of data stored in each file, if possible.
I tried your command also, and it is running, the only problem is to add manually 1664 columns for the cut command, but I think I can work on It!
Hope I have been clear enough, and greatly appreciate your help!
Hello,
My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns:
File A: (tab-delimited)
PDB CHAIN Start End Fragment
1avq A 171 176 awyfan
1avq A 172 177 wyfany
1c7k A 2 7... (3 Replies)
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 Friends,
I have a file1 with 3400 records that are tab separated and I have a file2 with 6220 records. I want to merge both these files. I tried using join file1 and file2 after sorting. But, the records should be (3400*6220 = 21148000). Instead, I get only around 11133567. Is there anything... (13 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 guys,
i need help
I need to join file2 to file1 when column 3 in my file1 and column 1 in my file2 in the same string
file1
AA|RR|ESKIM
RE|DD|RED
WE|WW|SUPSS
file2
ESKIM|ES
SUPSS|SS
Output
AA|RR|ESKIM|ES
RE|DD|RED|
WE|WW|SUPSS|SS (3 Replies)
Hello,
I have a file with 2 columns ( tableName , ColumnName) delimited by a Pipe like below . File is sorted by ColumnName.
Table1|Column1
Table2|Column1
Table5|Column1
Table3|Column2
Table2|Column2
Table4|Column3
Table2|Column3
Table2|Column4
Table5|Column4
Table2|Column5
From... (6 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 REDHAT
diff3
DIFF3(1) GNU Tools DIFF3(1)NAME
diff3 - find differences between three files
SYNOPSIS
diff3 [options] mine older yours
DESCRIPTION
The diff3 command compares three files and outputs descriptions of their differences.
The files to compare are mine, older, and yours. At most one of these three file names may be -, which tells diff3 to read the standard
input for that file.
Options
Below is a summary of all of the options that GNU diff3 accepts. Multiple single letter options (unless they take an argument) can be com-
bined into a single command line argument.
-a Treat all files as text and compare them line-by-line, even if they do not appear to be text.
-A Incorporate all changes from older to yours into mine, surrounding all conflicts with bracket lines.
-B Old behavior of -A. Shows non-conflicts.
-e Generate an ed script that incorporates all the changes from older to yours into mine.
-E Like -e, except bracket lines from overlapping changes' first and third files. With -e, an overlapping change looks like this:
<<<<<<< mine
lines from mine
=======
lines from yours
>>>>>>> yours
--ed Generate an ed script that incorporates all the changes from older to yours into mine.
--easy-only
Like -e, except output only the nonoverlapping changes.
-i Generate w and q commands at the end of the ed script for System V compatibility. This option must be combined with one of the
-AeExX3 options, and may not be combined with -m.
--initial-tab
Output a tab rather than two spaces before the text of a line in normal format. This causes the alignment of tabs in the line to
look normal.
-L label
--label=label
Use the label label for the brackets output by the -A, -E and -X options. This option may be given up to three times, one for each
input file. The default labels are the names of the input files. Thus diff3 -L X -L Y -L Z -m A B C acts like diff3 -m A B C ,
except that the output looks like it came from files named X, Y and Z rather than from files named A, B and C.
-m
--merge
Apply the edit script to the first file and send the result to standard output. Unlike piping the output from diff3 to ed, this
works even for binary files and incomplete lines. -A is assumed if no edit script option is specified.
--overlap-only
Like -e, except output only the overlapping changes.
--show-all
Incorporate all unmerged changes from older to yours into mine, surrounding all overlapping changes with bracket lines.
--show-overlap
Like -e, except bracket lines from overlapping changes' first and third files.
-T Output a tab rather than two spaces before the text of a line in normal format. This causes the alignment of tabs in the line to
look normal.
--text Treat all files as text and compare them line-by-line, even if they do not appear to be text.
-v
--version
Output the version number of diff3.
-x Like -e, except output only the overlapping changes.
-X Like -E, except output only the overlapping changes. In other words, like -x, except bracket changes as in -E.
-3 Like -e, except output only the nonoverlapping changes.
SEE ALSO cmp(1), comm(1), diff(1), ed(1), patch(1), sdiff(1).
DIAGNOSTICS
An exit status of 0 means diff3 was successful, 1 means some conflicts were found, and 2 means trouble.
GNU Tools 22sep1993 DIFF3(1)