Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Merge two files with non-overlapping identities Post 302752931 by rdrtx1 on Monday 7th of January 2013 06:53:25 PM
Old 01-07-2013
If field to match in file2 is field 3 (rsID), try:
Code:
awk 'NR==FNR {a[$3]=$4" "$5" "$1" "$2; next} {if (a[$1]) {print $0, a[$1]} else {print $0, "\"\"", 0, "\"\""}}' file2 file1

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge files of differrent size with one field common in both files using awk

hi, i am facing a problem in merging two files using awk, the problem is as stated below, file1: A|B|C|D|E|F|G|H|I|1 M|N|O|P|Q|R|S|T|U|2 AA|BB|CC|DD|EE|FF|GG|HH|II|1 .... .... .... file2 : 1|Mn|op|qr (2 Replies)
Discussion started by: shashi1982
2 Replies

2. Cybersecurity

How to exclude openssh identities?

I have a few different ssh identities configured for my client. Sometimes I am logging into a system I don't manage that either limits the number of failing identities to a smaller number than I have configured, or is refusing because of a wrong identity (as opposed to finding a valid one and... (0 Replies)
Discussion started by: Skaperen
0 Replies

3. UNIX for Dummies Questions & Answers

finding overlapping names in different txt files

Dear Gurus, I have 57 tab-delimited different text files, each one containing entries in 3 columns. The first column in each file contains names of objects. Some names are present in more than one file. I would like to find those names and store them in a separate text file, preferably with a... (6 Replies)
Discussion started by: Unilearn
6 Replies

4. Shell Programming and Scripting

Checking in a directory how many files are present and basing on that merge all the files

Hi, My requirement is,there is a directory location like: :camp/current/ In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Discussion started by: srikanth_sagi
10 Replies

5. Shell Programming and Scripting

Merge files and generate a resume in two files

Dear Gents, Please I need your help... I need small script :) to do the following. I have a thousand of files in a folder produced daily. I need first to merge all files called. txt (0009.txt, 0010.txt, 0011.txt) and and to output a resume of all information on 2 separate files in csv... (14 Replies)
Discussion started by: jiam912
14 Replies

6. Shell Programming and Scripting

Print the overlapping entries in 2 files to separate file

I have two files that contain overlapping positions. i want to put them together each overlapping entries in both files in to a new file (the entries of first file first and the entries of second file next) followed by blank line then next overlapping entries and so on. input1 chr1 22 ... (10 Replies)
Discussion started by: raj_k
10 Replies

7. 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

8. UNIX for Dummies Questions & Answers

Retrieving names of files in a dir without overlapping

Hi, I have been trying to retrieve the names of files present in a directory one by one but the names of files are getting overlapped on one another. I tried the below command. ls -1 > filename please help me in getting the file names line by line without overlapping. I am using korn... (6 Replies)
Discussion started by: Pradhikshan
6 Replies

9. UNIX for Beginners Questions & Answers

Merge 4 bim files by keeping only the overlapping variants (unique rs values )

Dear community, I am facing a problem and I kindly ask your help: I have 4 different data sets consisted from 3 different types of array. On each file, column 1 is chromosome position, column 2 is SNP id etc... Lets say I have the following (bim) datasets: x2014: 1 rs3094315... (4 Replies)
Discussion started by: fondan
4 Replies
INTLTOOL-MERGE(8)					      System Manager's Manual						 INTLTOOL-MERGE(8)

NAME
intltool-merge - merge translated strings into various types of file SYNOPSIS
intltool-merge [option]... PO_DIRECTORY FILENAME OUTPUT_FILE DESCRIPTION
Merge translated strings in po files in PO_DIRECTORY with the original application file FILENAME, and output the file OUTPUT_FILE contain- ing both original and localized strings. If FILENAME is an XML file, OUTPUT_FILE will contain repeated xml nodes, where each node contains one of the localized strings with "xml:lang" attribute. OPTIONS
Mode of operation -b --ba-style Merge files in bonobo-activation style, which is used for bonobo servers. -d --desktop-style Merge files in desktop style, which is similar to the Windows .ini file format. -k --keys-style Merge files in keys style, which is used for metadata. -o --oaf-style (OBSOLETE) Same as -b/--ba-style. -r --rfc822deb-style Merge files in RFC 822 style, which is usually used in Debian configuration files. --quoted-style Merge files in quoted string style, which just translates any strings within "". -x --xml-style Merge files in standard XML style, both as attributes and as raw pcdata. Other options -u --utf8 Convert all strings to UTF-8 before merging. -p --pass-through Use strings as is in .po files without conversion (STRONGLY unrecommended with -x). -c --cache (TBD) -q --quiet Be quiet while running. -v --version Show version information. -h --help Show usage and basic help information. FILES
po/.intltool-merge-cache Cache file generated by intltool-merge, that contains all strings in all po files separated by 1. REPORTING BUGS
Report bugs to http://bugs.launchpad.net/intltool AUTHOR
Darin Adler <darin@bentspoon.com> Kenneth Christiansen <kenneth@gnu.org> Maciej Stachowiak <mjs@eazel.com> SEE ALSO
iconv(1), intltoolize(8), intltool-prepare(8), intltool-extract(8), intltool-update(8) intltool 2003-08-02 INTLTOOL-MERGE(8)
All times are GMT -4. The time now is 08:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy