Sponsored Content
Top Forums Shell Programming and Scripting Join 2nd column of multiple files Post 302959023 by RudiC on Wednesday 28th of October 2015 05:24:44 AM
Old 10-28-2015
Any attempt from your side?

---------- Post updated at 10:24 ---------- Previous update was at 10:21 ----------

Howsoever, try
Code:
awk 'FNR==1{TTL=TTL OFS FILENAME} {VAL[$1]=VAL[$1] OFS $2} END {print TTL; for (v in VAL) print v, VAL[v]}' OFS="\t" file[12]

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing out 2nd column into one file from multiple files

I have several files that are being generated every 20 minutes. Each file contains 2 columns. The 1st column is Text, 2nd column is Data. I would like to generate one single file from all these files as follows: One instance of 1st column Text, followed by 2nd column Data separated by... (5 Replies)
Discussion started by: subhap
5 Replies

2. UNIX for Dummies Questions & Answers

Join 2 files with multiple columns: awk/grep/join?

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)
Discussion started by: InfoSeeker
3 Replies

3. UNIX for Dummies Questions & Answers

Join 2 files using first column

Hi, I'm trying to compare the first column of two files (tab or whitespace delimited, either way's fine, I`ve got both) and print the lines that are identical for the first column of both files. Something like this: File1 AAA 26 49 7 27 36 33 46 75 73 69 AAAAA 4 10 4 7 10 18 21... (2 Replies)
Discussion started by: vanesa1230
2 Replies

4. Shell Programming and Scripting

Join multiple files by column with awk

Hi all, I searched through the forum but i can't manage to find a solution. I need to join a set of files placed in a directory (~1600) by column, and obtain an output with first and second column common to each file, but following columns are taken from the file in the list (precisely the fourth... (10 Replies)
Discussion started by: macsx82
10 Replies

5. Shell Programming and Scripting

Join multiple files based on 1 common column

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)
Discussion started by: quincyjones
9 Replies

6. Shell Programming and Scripting

comparing column of two different files and print the column from in order of 2nd file

Hi friends, My file is like: Second file is : I need to print the rows present in file one, but in order present in second file....I used while read gh;do awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile done < secondfile but the output I am... (14 Replies)
Discussion started by: CAch
14 Replies

7. UNIX for Dummies Questions & Answers

How to use the the join command to join multiple files by a common column

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)
Discussion started by: evelibertine
5 Replies

8. UNIX for Dummies Questions & Answers

Join files by second column

I have file input file1 1/1/2013 A 553.0763397 96 16582 1/1/2013 B 459.8333588 195 11992 1/2/2013 A 844.2973022 306 19555 1/2/2013 B 833.9300537 457 20165 1/3/2013 A 563.6917419 396 13879 1/3/2013 B 632.0749969 169 ... (1 Reply)
Discussion started by: radius
1 Replies

9. Shell Programming and Scripting

Difference between 2 files, one with 1 column and 2nd file with multiple columns

Hi, I need to find the difference between 2 files in unix and write the result in the new file File1: A B File2: X 123 hajkd Y 345 adjfka A 123 djafjhd B 678 dsndjks Output file: X 123 hajkd Y 345 adjfka Thanks. (6 Replies)
Discussion started by: nani1984
6 Replies

10. Shell Programming and Scripting

Join columns across multiple lines in a Text based on common column using BASH

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)
Discussion started by: nv186000
6 Replies
ckport(1)						   System User's Manual: ckport 						 ckport(1)

NAME
ckport - portability analysis and security checking tool SYNOPSIS
ckport [OPTIONS]... file [file,...] DESCRIPTION
ckport is a tool to check already compiled binaries and libraries for porting and security problems. It uses objdump to read the binaries and analysis call and jump functions. This package is architecture independent and can be used on non-host architecture binaries if a objdump tool for the target architecture is installed. OPTIONS
--help -h Show this help. -- End of options, only filenames follow. --mode MODE Sets mode of operation. --db DBFILE Load database DBFILE. --db-dir DBDIR Load databases from directory DBDIR. --edit-vim Show vim command pointing to location of problem. --conf KEY=VAL Set config key KEY to value VAL. --warn-mode MODE Set mode for printing of warnings. --warn PT Warn about problems of type PT. --nowarn PT Ignore warnings about problems of type PT. --nowarns Disable all warnings. --nosummery Disable summery. --summery Enable summery. --summery-on-warn Only print summery if warnings has been found. --noheader Disable printing of headers. --header Enable printing of headers. --nofile-header Disable printing of headers for each file (operant). --file-header Enable printing of headers for each file (operant). --ignore PATTERN Ignore symbols matching this Perl regex pattern. --ignore-symbol SYMBOL Ignore symbol SYMBOL. --ignore-target TARGET Ignore warnings for target TARGET. --print-mode MODE Set mode of symbol printing to MODE. --print-unknown Print unknown symbols found. --print-unknown-defined Print list of unknown but defined (internal) symbols. --print-unused Print list of defined (internal) but unused symbols. --print-known Print list of known symbols. --print-pt Print list of known problem types. SEE ALSO
objdump(1). ckport April 2011 ckport(1)
All times are GMT -4. The time now is 01:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy