File1 row is same as column 2 in file 2.
Also file 2 will either start with A, B or C.
And 3rd column in file 2 is always F2.
When column 2 of file 2 matches file1 column, print all those rows into a separate file.
Here is an example.
file 1:
100
103
104
108
file 2:
... (6 Replies)
I have read another post about this issue and am wondering how to adapt it
to my own, much simpler, issue.
I have a file of user IDs like so:
333333
321321
546465
...etc
I need to take each number and use it to print records wherein the 5th
field matches the user ID pulled from the... (2 Replies)
file1 has pgap500 500
file2 has bunch of data
cat file1 file2 > file3
cp file2 file3.dat then vi pgap500 500 onto 1st line
compare file3 and fil3.dat, they are not the same.
any idea ? the 1st line, i want to put pg500 xxx
---------- Post updated at 07:35 AM ---------- Previous... (2 Replies)
I have very limited coding skills but I'm wondering if someone could help me with this. There are many threads about matching strings in two files, but I have no idea how to add a column from one file to another based on a matching string.
I'm looking to match column1 in file1 to the number... (3 Replies)
Hi all,
My requirement is that i have two files file1 and file2. file1 content is present in file2. i want to have a final which will have file2 contents but not the contents of file1 so I am running below command.
fgrep -vf file1 file2>file3
no of records in file1 is 65282
no of records... (10 Replies)
Platform : Oracle linux 6.5
I have two log files with the following contents
# ls -l
total 8
-rw-r--r--. 1 root root 75 Dec 10 20:55 myLogfile1.log
-rw-r--r--. 1 root root 51 Dec 10 20:57 myLogfile2.log
#
# cat myLogfile1.log
hello world
jaded zombies acted quaintly but kept driving... (9 Replies)
I want to print only the lines in file2 that match file1, in the same order as they appear in file 1
file1
file2
desired output:
I'm getting the lines to match
awk 'FNR==NR {a++}; FNR!=NR && a' file1 file2
but they are in sorted order, which is not what I want:
Can anyone... (4 Replies)
Hi everyone,
I would like to complete the following could you please find some time and help me to achieve below:
File 1 has a list of IP address (more than 1k)
File1:1.1.1.1
2.2.2.2
1.1.1.2
3.3.3.3
2.3.3.2File 2 has content like this:Internet 11.165.91.244 0 Incomplete ... (4 Replies)
I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited.
I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
Hi
Does anyone know of an efficient way to index a column of data in file2 to print the coresponding row in file1 which corresponds to the data in file2 AND 30 rows preceding and after the row in file1.
For example suppose you have a list of numbers in file2 (single column) as follows:... (6 Replies)
Discussion started by: Geneanalyst
6 Replies
LEARN ABOUT MINIX
diff
DIFF(1) General Commands Manual DIFF(1)NAME
diff - print differences between two files
SYNOPSIS
diff [-c | -e | -C n] [-br]file1 file2
OPTIONS -C n Produce output that contains n lines of context
-b Ignore white space when comparing
-c Produce output that contains three lines of context
-e Produce an ed-script to convert file1 into file2
-r Apply diff recursively to files and directories of
EXAMPLES
diff file1 file2 # Print differences between 2 files
diff -C 0 file1 file2
# Same as above
diff -C 3 file1 file2
# Output three lines of context with every
diff -c file1 file2 # Same
diff /etc /dev # Compares recursively the directories /etc and /dev
diff passwd /etc # Compares ./passwd to /etc/passwd
DESCRIPTION
the same name, when file1 and file2 are both directories" difference encountered"
Diff compares two files and generates a list of lines telling how the two files differ. Lines may not be longer than 128 characters. If
the two arguments on the command line are both directories, diff recursively steps through all subdirectories comparing files of the same
name. If a file name is found only in one directory, a diagnostic message is written to stdout. A file that is of either block special,
character special or FIFO special type, cannot be compared to any other file. On the other hand, if there is one directory and one file
given on the command line, diff tries to compare the file with the same name as file in the directory directory.
SEE ALSO cdiff(1), cmp(1), comm(1), patch(1).
DIFF(1)