Hi Guys,
I wonder whether is possible to merge two files using awk. I have two files one with 7 columns and another one with 9 columns and the first column on both files is identical so will be my key to merge the files. Any ideas.Thanks in advance.
Harby. (2 Replies)
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)
I have 2 files pipe delimted and want to merge them based on a key
e.g file 1
123$aaa$yyy$zzz
345$xab$yzy$zyz
456$sss$ttt$foo
799$aaa$ggg$dee
file 2
123$hhh
345$ddd
456$xxx
888$zzz
so if the key is the first field, and the result should be the common key between file 1 and 2 (6 Replies)
I want to merge data from 2nd file to 1st file based on 1st column
File1
====
data1,12,comp1
data1,13,comp2
data3,14,,
File2
====
data1,11,host1,lit
data2,11,host2,lit3
data3,11,host3,lit4
Required Ouput (5 Replies)
Dear programmers,
I have a question about conditionally merging multiple files and having their file names in the first column.
Input files:
file.1.extension file.2.extension file.3.extension file.4.extension ... file.1000.extension
where each file looks like this (with multiple lines):... (5 Replies)
I have two file like follows. I want to merge them according the first field of file1. The separator of file1 is tab, while the second one is ",". I tried some code, but can't get the results.
File1:
AABB 6072 28 5922
BBCC 316 147 162
CCDD 907 71 231
File2:
CCDD,hTRBV12-4,hTRBJ2-3,319895... (7 Replies)
Dear Awk experts!
I have been trying to get a one liner for a match and merge operation, but having difficulties as I'm an awk newb. I always get stuck on the match and merge with 2 files.
I have 2 files as follows:
File 1:
field 1,field 2,field 3,field 4,field 5,field 6,field 7,field... (6 Replies)
Hi,
i have two files like these:
FILE 1
00:0f:35:1b:0c:00 1402691094.750049000 00:0f:35:1b:0c:00 1402691087.474893000
44:d3:ca:fd:a2:08 1402691091.865127000
30:e4:db:c1:df:de 1402691090.192464000
FILE 2_
00:0F:35 Cisco Systems, Inc
30:E4:DB Cisco Systems, Inc
I need a file 3, that... (5 Replies)
I have two csv files : say a.csv, b.csv
a.csv looks like this :
property1,property2,100
property3,property4,200
In a.csv, the combination of column1 and column2 will be unique
b.csv looks like this
property1,property2, 300, t1
property1,property2, 400,t2
property3, property4,800,t1... (2 Replies)
Discussion started by: Lakshmikumari
2 Replies
LEARN ABOUT OPENSOLARIS
join
join(1T) Tcl Built-In Commands join(1T)__________________________________________________________________________________________________________________________________________________NAME
join - Create a string by joining together list elements
SYNOPSIS
join list ?joinString?
_________________________________________________________________DESCRIPTION
The list argument must be a valid Tcl list. This command returns the string formed by joining all of the elements of list together with
joinString separating each adjacent pair of elements. The joinString argument defaults to a space character.
EXAMPLES
Making a comma-separated list:
set data {1 2 3 4 5}
join $data ", "
=> 1, 2, 3, 4, 5
Using join to flatten a list by a single level:
set data {1 {2 3} 4 {5 {6 7} 8}}
join $data
=> 1 2 3 4 5 {6 7} 8
SEE ALSO list(1T), lappend(1T), split(1T)KEYWORDS
element, join, list, separator
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tcljoin(1T)