Sponsored Content
Full Discussion: Joining
Top Forums Shell Programming and Scripting Joining Post 302797993 by Corona688 on Tuesday 23rd of April 2013 02:55:24 PM
Old 04-23-2013
Code:
awk '

F != FILENAME { FILENO++ ; F=FILENAME }
{ A[$1,FILENO]=$2 }
!($1 in C) { C[$1]++; COL[++L]=$1 }

END {
        for(N=1; N<=L; N++)
        {
                printf("%d", COL[N]+0);
                for(FILE=1; FILE<=FILENO; F++)
                        printf(" %d", A[COL[N],FILE]+0);
                printf("\n");
        }
}' file1 file2 file3 ...

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

joining 2 files

Hi, I have two files that I need to find difference between. Do I use diff or join? If join, how do I use it? thanks, webtekie (1 Reply)
Discussion started by: webtekie
1 Replies

2. Shell Programming and Scripting

Help with joining two files

Greetings, all. I've got a project that requires I join two data files together, then do some processing and output. Everything must be done in a shell script, using standard unix tools. The files look like the following: File_1 Layout: Acct#,Subacct#,Descrip Sample: ... (3 Replies)
Discussion started by: rjlohman
3 Replies

3. Shell Programming and Scripting

Joining Variables

Hi Everyone, Thanks in advance for what is hopefully a simple thing. Big picture I am trying to bind computers to AD using their existing name but add a suffix. Here is the part I am having trouble with: computername=`/usr/sbin/scutil --get LocalHostName` suffix=suffix... (2 Replies)
Discussion started by: dcc186
2 Replies

4. Shell Programming and Scripting

Joining of Commands.

Hello, i have a few questions which i hope you guys can address. the 1st prob: The database i am using is a text file which displays the information like this : Title : Quantity : Price Persia : 30 : 20 ... (5 Replies)
Discussion started by: gregarion
5 Replies

5. Shell Programming and Scripting

Need help joining lines

Hi All, I need the command to join 2 lines into one. I found lots of threads but none give me the sollution. Probably because unix scripting is one of my best features ;) I got a logfile where line 2 needs to be joined with line 1, lines 4 needs to be joined with line 3 etc If you need... (16 Replies)
Discussion started by: rene21976
16 Replies

6. Shell Programming and Scripting

variable joining

I really need help on this problem. The story: My VAR1 and VAR2 works fine and able to get the value. I want to do as "if VAR1 or VAR2 is bigger than max_loadavg then the code will run...then if VAR1 or VAR2 is lesser than min_loadavg then the other code will run... The problem: The... (8 Replies)
Discussion started by: hezry79
8 Replies

7. Shell Programming and Scripting

Joining Three Files

Hi guys, I have three files which needs to be joined to a single file. File 1: Col a, Col b, Col c File 2: Col 1a, Col 1b File 3: Col 2a, Col 2b Output: Col 1a, Col 2a, Col a, Col b, Col c. All the files are comma delimited. I need to join Col b with Col 1b and need to... (17 Replies)
Discussion started by: mac4rfree
17 Replies

8. Shell Programming and Scripting

Joining 2 Files

File "A" (column names: Nickname Number GB) Nickname Number GB PROD_DB0034 100A 16 ASMIL1B_DATA_003 100B 16 PSPROD_0000 1014 36 PSPROD_0001 100D 223 ..... File "B" (column names: TYPE DEVICE NUMBER SIZE) TYPE DEVICE NUMBER SIZE 1750500 hdisk2 100A 16384 1750500 hdisk3 ... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

9. Shell Programming and Scripting

Joining lines in different way

Hi all, I'm excited to the part of unix.com forum, and noob to it. I have an query, where I have an file and it contains data like this use thread when posting do no I was expecting the result as use thread thread when when posting posting do do no use thread when thread when... (6 Replies)
Discussion started by: Jose Nirmal
6 Replies

10. Shell Programming and Scripting

Please help me in joining two files

I have two files with the below contents : sampleoutput3.txt 20150202;hostname1 20150223;hostname2 20150716;hostname3 sampleoutput1.txt hostname;packages_out_of_date;errata_out_of_date; hostname1;11;0; hostnamea;12;0; hostnameb;11;0; hostnamec;95;38; hostnamed;440;358;... (2 Replies)
Discussion started by: rahul2662
2 Replies
HOBBIT-NKEDIT.CGI(1)					      General Commands Manual					      HOBBIT-NKEDIT.CGI(1)

NAME
hobbit-nkedit.cgi - Xymon Critical Systems view CGI SYNOPSIS
hobbit-nkedit.cgi DESCRIPTION
hobbit-nkedit.cgi is invoked as a CGI script via the hobbit-nkedit.sh CGI wrapper. hobbit-nkedit.cgi is a web-based editor for the hobbit-nkview.cfg(5) file, which is used to configure the Xymon "Critical Systems" view. A detailed description of how to use the editor is provided in the Xymon Web documentation, available from the "Help" -> "Critical Systems" link on the Xymon website. SECURITY
Access to this CGI script should be restricted through access controls in your webserver. Editing the Critical Systems View configuration will impact the monitoring of your site. OPTIONS
--config=FILENAME Name of the Critical Systems View configuration file. The default is hobbit-nkview.cfg in the $BBHOME/etc/ directory. --env=FILENAME Loads the environment defined in FILENAME before executing the CGI script. --area=NAME Load environment variables for a specific area. NB: if used, this option must appear before any --env=FILENAME option. --debug Enables debugging output. SEE ALSO
hobbit-nkview.cgi(1), xymon(7) Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-NKEDIT.CGI(1)
All times are GMT -4. The time now is 01:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy