10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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)
Discussion started by: cmccabe
6 Replies
3. Shell Programming and Scripting
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)
Discussion started by: redred
4 Replies
4. UNIX for Dummies Questions & Answers
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)
Discussion started by: pathunkathunk
4 Replies
5. UNIX for Dummies Questions & Answers
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)
Discussion started by: kraljic
9 Replies
6. Shell Programming and Scripting
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)
Discussion started by: Lakshman_Gupta
10 Replies
7. UNIX for Dummies Questions & Answers
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)
Discussion started by: pathunkathunk
3 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: tjmannonline
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: Bubnoff
2 Replies
10. UNIX for Advanced & Expert Users
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)
Discussion started by: i.scientist
6 Replies