Sponsored Content
Top Forums Shell Programming and Scripting awk cross-referencing between two files Post 302528030 by vgersh99 on Monday 6th of June 2011 09:51:45 AM
Old 06-06-2011
Code:
nawk 'FNR==NR {if($1<3) f1[$3];next} !($5 in f1)' file1 file2

This User Gave Thanks to vgersh99 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Referencing a range of parameters?

I can't seem to find anywhere how to syntactically reference a range of parameters in the script I am trying to write. My script requires at least 2 parameters to run, with parameter 1 being the main file, which I want appended to x amount of target files, which will be parameters 2 through... (4 Replies)
Discussion started by: Relykk
4 Replies

2. Shell Programming and Scripting

Referencing variables in commands

The script I am writing must be able to run several commands (tar, gzip etc) on filenames that are supplied by variables. I am unsure as to what syntax is required/ideal when referencing variables in filenames. The following is a sample command that I would like the script to execute: tar cvf... (3 Replies)
Discussion started by: mharley
3 Replies

3. Shell Programming and Scripting

files cross over

I have many files (File 1, File 2, File 3, ...) in same directory. The format of all these files are same. What I would like to do is to combine all these files into a single file via cross over. Example) >>File 1 look like this. f1 01 1.0 f1 02 2.0 f1 03 3.0 f1 04 4.0 f1 05 5.0 f1 06... (2 Replies)
Discussion started by: Jae
2 Replies

4. Programming

Symbol referencing error

Hey everyone, I can't figure out this symbol referencing error after looking at it for the longest time, and I figured some fresh eyes might be able to point something out I am overlooking. Undefined first referenced symbol in... (1 Reply)
Discussion started by: fromatz
1 Replies

5. Shell Programming and Scripting

Variable Referencing

I am referencing variables in the following way var1="greeting" greeting="Welcome!" How do I echo var1 in such a way that it outputs Welcome! ? (3 Replies)
Discussion started by: milo7
3 Replies

6. Shell Programming and Scripting

Cross checking two files

i have two files which contains some fields separated by columns as 03/29/1999 08:48:12 02 172.16.114.50 03/29/1999 09:08:00 480 172.16.112.100 Both of the files do have the same format I want the script which will take two such... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

7. UNIX for Dummies Questions & Answers

Cross complie linux make files onto a windows 7 machine using PGI Cygwin

Hello, I am very unfamiliar with linux/unix (don't even know the difference), but am trying to get some linux software to run on my Windows machine for my research. I have the makefiles for the software, and it is designed to be compiled in the PGI complier, which I also have. When i... (6 Replies)
Discussion started by: roba87
6 Replies

8. Shell Programming and Scripting

Referencing file for values and referencing another file to replace values

Hi I have a file which has values in each line: MP304,d40000 MP310,ff0000 etc I have another file which as the first value in it and is unique in the file(not repeated). I need to replace a string with the second value above. The second file contents is as follows:(snippet) <g ... (12 Replies)
Discussion started by: majikins
12 Replies

9. Shell Programming and Scripting

Dynamically referencing a Path

How would I reference a source path (where I have a script pulling data from) that changes location? For example, a Mail folder is being used as a source to pull some data, but somebody could move the folder around in the GUI of Mail, changing it's location in the filesystem (that I am referencing... (11 Replies)
Discussion started by: sudo
11 Replies
JOIN(1) 						      General Commands Manual							   JOIN(1)

NAME
join - relational database operator SYNOPSIS
join [ options ] file1 file2 DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If file1 is `-', the standard input is used. File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in each line. There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con- sists of the common field, then the rest of the line from file1, then the rest of the line from file2. Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are dis- carded. These options are recognized: -an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2. -e s Replace empty output fields by string s. -jn m Join on the mth field of file n. If n is missing, use the mth field in each file. -o list Each output line comprises the fields specified in list, each element of which has the form n.m, where n is a file number and m is a field number. -tc Use character c as a separator (tab character). Every appearance of c in a line is significant. SEE ALSO
sort(1), comm(1), awk(1) BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort. The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous. 7th Edition April 29, 1985 JOIN(1)
All times are GMT -4. The time now is 05:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy