Sponsored Content
Top Forums Shell Programming and Scripting Combine multiple columns from multiple files Post 302263355 by joeyg on Monday 1st of December 2008 11:20:45 AM
Old 12-01-2008
Hammer & Screwdriver Here is an approach using awk

Code:
> cat file87
c0t0d0 c0t2d0 # hostname vgname
c0t0d1 c0t2d1 # hostname vgname
c0t0d2 c0t2d2 # hostname vgname
c0t1d0 c0t3d0 # hostname vgname1
c0t1d3 c0t3d3 # hostname vgname1
> cat file88
c0t0d0 c0t4d0 # hostname1 vgname
c0t0d1 c0t4d1 # hostname1 vgname
c0t0d2 c0t4d2 # hostname1 vgname
c0t1d0 c0t6d0 # hostname1 vgname1
c0t1d3 c0t6d3 # hostname1 vgname1

> cat f87_88
awk ' FILENAME=="file87" { dat[$1]=$2}
      FILENAME=="file88" { 
        if(FNR > 0)
        { print dat[$1]" "$2" "$3" "$4" "$5}
      
      } ' file87 file88
       
> f87_88
c0t2d0 c0t4d0 # hostname1 vgname
c0t2d1 c0t4d1 # hostname1 vgname
c0t2d2 c0t4d2 # hostname1 vgname
c0t3d0 c0t6d0 # hostname1 vgname1
c0t3d3 c0t6d3 # hostname1 vgname1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need help with post:extract multiple columns from multiple files

hello, I will would be grateful if anyone can help me reply to my post extract multiple cloumns from multiple files; skip rows and include filenames; awk Please see this thread. Thanks manishabh (0 Replies)
Discussion started by: manishabh
0 Replies

2. UNIX for Dummies Questions & Answers

Combine multiple files with common string into one new file.

I need to compile a large amount of data with a common string from individual text files throughout many directories. An example data file is below. I want to search for the following string, "cc_sectors_1" and combine all the data from each file which contains this string, into one new... (2 Replies)
Discussion started by: GradStudent2010
2 Replies

3. Shell Programming and Scripting

combine multiple files by column into one files already sorted!

I have multiple files; each file contains a certain data in a column view simply i want to combine all those files into one file in columns example file1: a b c d file 2: 1 2 3 4 file 3: G (4 Replies)
Discussion started by: ahmedamro
4 Replies

4. Emergency UNIX and Linux Support

Combine multiple Files into one big file

Hi Ppl, I have a requirement like i will be getting files of huge size daily and if the file size is so huge ,the files will be split into many parts and sent.The first file will have the header details followed by detail records and the consecutive files will have detail records and the last... (11 Replies)
Discussion started by: ganesh_248
11 Replies

5. Shell Programming and Scripting

Combine columns from multiple files

Can anybody help on the script to combine/concatenate columns from multiple files input1 4 135 5 185 6 85 11 30 16 72 17 30 21 52 22 76 input2 2 50 4 50 6 33 8 62 10 25 12 46 14 42 15 46output (2 Replies)
Discussion started by: sdf
2 Replies

6. UNIX for Dummies Questions & Answers

cutting multiple columns into multiple files

Hypothetically, suppose that file1 id v1 v2 v3 v4 v5 v6 v7..........v100 1 1 1 1 1 1 2 2 .....50 2 1 1 1 1 1 2 2 .....50 3 1 1 1 1 1 2 2 .....50 4 1 1 1 1 1 2 2 .....50 5 1 1 1 1 1 2 2 .....50 I want to write a loop such that I take the id# and the first 5 columns (v1-v5) into the... (3 Replies)
Discussion started by: johnkim0806
3 Replies

7. Shell Programming and Scripting

Compare multiple files with multiple number of columns

Hi, input file1 abcd 123 198 xyz1:0909090-0909091 ghij 234 999 xyz2:987654:987655 kilo 7890 7990 xyz3:12345-12357 prem 9 112 xyz5:97-1134 input file2 abcd 123 198 xyz1:0909090-0909091 -9.122 0 abed 88 98 xyz1:98989-090808 -1.234 1.345 ghij 234 999 xyz2:987654:987655 -10.87090909 5... (5 Replies)
Discussion started by: jacobs.smith
5 Replies

8. Shell Programming and Scripting

Merging multiple files from multiple columns

Hi guys, I have very basic linux experience so I need some help with a problem. I have 3 files from which I want to extract columns based on common fields between them. File1: --- rs74078040 NA 51288690 T G 461652 0.99223 0.53611 3 --- rs77209296 NA 51303525 T G 461843 0.98973 0.60837 3... (10 Replies)
Discussion started by: bartman2099
10 Replies

9. Shell Programming and Scripting

Combine Multiple Files into Single One File One after other

I am trying to combine 4 .dat files into one single Output file Inputs are:- file123.dat, file256.dat, file378.dat & file490 Expected Output:- FileName=file1 {text from file1} EOF {blank line} FileName=file2 {text from file2} EOF {blank line} FileName=file3 {text from file3} EOF... (4 Replies)
Discussion started by: lancesunny
4 Replies

10. Shell Programming and Scripting

Removing carriage returns from multiple lines in multiple files of different number of columns

Hello Gurus, I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file. 1|ABC DEF|100|10 2|PQ RS T|200|20 3| UVWXYZ|300|30 4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies
jserver(1M)                                               System Administration Commands                                               jserver(1M)

NAME
jserver - Wnn6 Kana-Kanji conversion server SYNOPSIS
/usr/lib/locale/ja/wnn/jserver [-f file] [-s file] [-h file] [-A file] [-N no] [-pno port_no] [-ds default_wnnds_list] [ + ds] DESCRIPTION
jserver provides one or more users with Kana-Kanji conversion features for Japanese input. It is launched normally from /etc/rc2.d/S94Wnn6 upon the system startup. jserver reads and processes the initialization file /etc/lib/locale/ja/wnn/ja/jserverrc when launched. OPTIONS
The following options are available. -f file Reads as the initialization file instead of the default initialization file /etc/lib/locale/ja/wnn/ja/jserverrc. -s file Stores log in file. When "-" is specified for file, the output is directed to the standard output. -h file Reads as the part of speech data file instead of the default part of speech data file /usr/lib/locale/ja/wnn/ja/hinsi.data. -A file Reads as the access control file instead of the default access conntrol file /etc/lib/locale/ja/wnn/wnnhosts. -N no Uses the value obtained by adding no to the well-known port number(22273), as TCP port number. -pno port_no Uses port_no as TCP port number instead of the well-known port number. -ds default_wnndSpecifies the list of the default dictionary lookup servers. One of the following formats is used for dictionary lookup server. hostname Specifies the dictionary lookup server that uses the well-known port number(26208) on host hostname. hostname:Specifies the dictionary lookup server that uses the well-known port number + no as port number on host hostname. hostname/Specifies the dictionary lookup server that uses port_no as port number on host hostname . Up to three dictionary lookup server can be specified by separating them with a ",". Example: hostname1,hostname2:10,hostname/26228 When this option is used, jserver tries to search and connect to the dictionary lookup server in the order specified on the startup. The dictionary lookup server first connected is used as default server. If this option is omitted and the default dictionary lookup server is defined in the initialization file jserverrc, the default server is tried. If either this option is not specified or the default dictionary lookup server is not defined in the initialization file, jserver does not connect to the dictionary lookup server by default but uses relevant dictionary files directly. FILES
/tmp/jd_sockV6 UNIX domain socket /etc/lib/locale/ja/wnnja/jserverrc jserver initialization file /etc/lib/locale/ja/wnn/wnnhosts Wnn6 access control file /usr/lib/locale/ja/wnn/ja/hinsi.data Wnn6 part of speech data file /usr/lib/locale/ja/wnn/ja/dic/iwanami/* Wnn6 system dictionary ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWjwnsu | +-----------------------------+-----------------------------+ SEE ALSO
wnnstat(1), wnnaccess(1M), wnnds(1M), wnnkill(1M), jserverrc(4), wnnhosts(4) SunOS 5.10 10 Jan 2003 jserver(1M)
All times are GMT -4. The time now is 08:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy