Like this?
---------- Post updated at 12:30 ---------- Previous update was at 12:21 ----------
Or shorter: ---------- Post updated at 12:56 ---------- Previous update was at 12:30 ----------
Quote:
Originally Posted by swvanderlaan
[..]I just have some questions about the code though: can you explain the parts? I don't fully understand what each part does, and than if I'd understand I could learn maybe new commands to work my files.
NR==FNR
If we are reading the first file (The variables NR and FNR are only equal when reading the first file)
A[$1]=$2
store the second field in array a using the index of the first field
next
proceed to read the next record
A[$1]
if A[$1] exists (using the $1 of the second file)
$2=A[$1] FS $2;print
then append FS (a comma) followed by A[$1] (using the $1 of the second file)
Here is my situation. I need to compare two tab separated files (diff is not useful since there could be known difference between files).
I have found similar posts , but not fully matching.I was thinking of writing a shell script using cut and grep and while loop but after going thru posts it... (2 Replies)
Hi ,
Pls help on this.
Input file:
NAME1 BSC1
TEXT ID 1
MAINSFAIL
TEXT ID 2
DGON
TEXT ID 3
lOADONDG
NAME2 BSC2
TEXT ID 1
DGON
TEXT ID 3
lOADONG (1 Reply)
I have a file1 that looks like this:
File 1
a b
b c
c e
d e
and a file 2 that looks like this:
File 2
b
c
e
e
Note that file 2 is the right hand column from file1. I want to remove any lines from file1 that begin with the column in file2. In this case the desired output... (6 Replies)
My item was not answered on previous thread as code given did not work
I wanted to print records from file2 where comparing column 1 and 16 for both files find rows where column 16 in file 1 does not match column 16 in file 2
Here was CODE give to issue
~/unix.com$ cat f1... (0 Replies)
I have a requirement where in i need to select records right below the search criteria
qwertykeyboard white
10 20 30
30 40 50
60 70 80
qwertykeyboard black
40 50 60
70 90 100
qwertykeyboard and white are headers separated by a tab.
when i execute my script..i would be searching... (4 Replies)
file1:
file2:
I need to find matches for any lines in file1 that appear in file2. Desired output is '>' plus the file1 term, followed by the line after the match in file2 (so the title is a little misleading):
This is honestly beyond what I can do without spending the whole night on it, so I'm... (2 Replies)
Hi,
I hope somebody can help me with this problem, since I would like to solve this problem using awk, but im not experienced enough with this.
I have two files which i want to match, and output the matching column name and row number.
One file contains 4 columns like this:
FILE1:
a ... (6 Replies)
At the top of the XYZ file, I need to insert the ABC data value of column 2 only when ABC column 1 matches the prefix XYZ file name (not the ".txt"). Is there an awk solution for this?
ABC Data
0101 0.54
0102 0.48
0103 1.63
XYZ File Name
0101.txt
0102.txt
0103.txt
... (7 Replies)
Hi,
I am trying to merge two csv files based on matching criteria:
File description is as below :
Key_File :
000|ÇÞ|Key_HF|ÇÞ|Key_FName
001|ÇÞ|Key_11|ÇÞ|Sort_Key22|ÇÞ|Key_31
002|ÇÞ|Key_12|ÇÞ|Sort_Key23|ÇÞ|Key_32
003|ÇÞ|Key_13|ÇÞ|Sort_Key24|ÇÞ|Key_33
050|ÇÞ|Key_15|ÇÞ|Sort_Key25|ÇÞ|Key_34... (3 Replies)
Hi all
I have two files I need to match record from first file and second file on column 1,8 and and output only match records on file1
File1:
020059801803180116130926800002090000800231000245204003160000000002000461OUNCE000000350000100152500BM01007W0000 ... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
LEARN ABOUT MINIX
zcmp
ZDIFF(1) General Commands Manual ZDIFF(1)NAME
zcmp, zdiff - compare compressed files
SYNOPSIS
zcmp [ cmp_options ] file1 [ file2 ]
zdiff [ diff_options ] file1 [ file2 ]
DESCRIPTION
Zcmp and zdiff are used to invoke the cmp or the diff program on files compressed via gzip. All options specified are passed directly to
cmp or diff. If only file1 is specified, it is compared to the uncompressed contents of file1.gz. If two files are specified, their con-
tents (uncompressed if necessary) are fed to cmp or diff. The input files are not modified. The exit status from cmp or diff is pre-
served.
SEE ALSO cmp(1), diff(1), zmore(1), zgrep(1), znew(1), zforce(1), gzip(1), gzexe(1)BUGS
Messages from the cmp or diff programs may refer to file names such as "-" instead of to the file names specified.
ZDIFF(1)