I don't really know how to achieve this in one-shot script, I am novice to Unix.
I can't decipher your attached files properly, so I created my own input files and worked on them... these files contain two columns each...and I wrote below two scripts to create third file FileC which contains duplicate rows initially but they are taken care of using sort and uniq commands...
Hi Gurus,
I have to join two flat files based on two key field columns. I concatenated two key fields and i tried the join command. It is working
fine. But, without using temporary files can't i use like this:
join -t ':' `awk -F ":" '{ printf("%s%s:%s\n", $1,$2, $0) }' file1` `awk -F ":" '{... (2 Replies)
Hi ,
I want to join 2 files based on 2 column join condition.
a11
john 2230 5000
a12
XXX 2230 A B 200 345
Expected O/P
John 2230 5000 A B 200
I have tried this
awk 'NR==FNR{a=$1;next}a&&sub($1,a)' a11 a12 > a13 (3 Replies)
Hi
i have file f1 like:
xx yy| 123
xx1 yy1| 1234
xx2 yy2|12345
f2 file like:
xx yy| aaa
xx1 yy1| bbb
xx2 yy2|cccc
i would like output is:
xx yy| 123|aaa
xx1 yy1| 1234|bbbb
xx2 yy2|12345|cccc
please help me on this........... (5 Replies)
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 two files and i want to join the contents like:
file a has content
my name is
i am
i work at
and file b has
John sims
43 years old
maximu ltd
and i want to join the two files to get a third file with content reading
my name is John sims
i am 43 years old
i work at... (2 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)
I have file1.txt
BGE179W1
BGE179W2
BGE179W3
BGE187W1
BGE187W2
BGE187W3
BGE194W1
BGE194W2
BGE194W3
BGE227W1
BGE227W2
BGE227W3
BGE288W1
BGE288W2
BGE288W3
BGE650W1
---------- Post updated at 12:41 AM ---------- Previous update was at 12:39 AM ---------- (5 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)