10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two files
I need to compare these two files and take the lines that are common in both the files and consider the line present in second file for my further processing
I have used "Awk" along with "FNR and NR" but that is not working
gawk -F= '
> FNR==NR {a=$1; next};
> ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
2. UNIX for Dummies Questions & Answers
I have 2 files with exactly the same information (with header and separated by ";") and what I would like to do is print (for both files!) the columns that are different and also print the "key" column that is equal in the 2 files For example, if
File1:
key1;aaa;bbb;ccc
key2;ddd;eee;fff... (4 Replies)
Discussion started by: mvalonso
4 Replies
3. Shell Programming and Scripting
Need help to create the script that does the following : -
1. Compare the current line "column B and C" with next line "column B and C"
2. If they are the same, print output to a file
Input file
2014-08-25 04:45:56.673|T1|JO|Begin|10
2014-08-25 04:55:56.673|T1|JO|Begin|11
2014-08-25... (8 Replies)
Discussion started by: chailee
8 Replies
4. Shell Programming and Scripting
I have a file lets say input.csv having two columns like-
Name,Mobile No
A,111
B,222
A,333
A,123
B,213
I would like to find result in a new file lets say output.csv as-
Name,Mobile No
A,111
B,222
means short the file on the basis of first column and first value corresponding to the... (5 Replies)
Discussion started by: Ashish Singhal
5 Replies
5. Shell Programming and Scripting
Hi Folks,
I need to compare the cron's timings from a text file. Need to display how much time does it took for that job.
For example i have the below txt file, I have cron1 started at 05:23:15 and completed at 05:25:57, now i need to find how much time did it took to complete corn1 job for... (8 Replies)
Discussion started by: Sendhil.Kumaran
8 Replies
6. Shell Programming and Scripting
could someone write a short script which is able to take a text file input and compare lines 1 and 2, 3 and 4, 5 and 6 ... ... until the end of the file. And to prompt if the lines are not equal.
Thank you! (10 Replies)
Discussion started by: c_lady
10 Replies
7. Shell Programming and Scripting
how to compare two lines using shell script? (1 Reply)
Discussion started by: suman_dba1
1 Replies
8. Shell Programming and Scripting
Greetings,
I'm new to scripting and need a little help. I have a NAS server and want to make a script that bans IP if they fail login several times.
The problem is that I dont know how to compare the IP's in the file. If they exist more than 3 times do ....
#!/bin/sh
set -x
X=4
rm... (2 Replies)
Discussion started by: ntenz
2 Replies
9. Shell Programming and Scripting
Hello,
I am newcomer and sorry for this simple question. I want to how to compare two lines in a file? For example, to compare the first line and the second line of a file to know if they are same?
Thanks in advance!
Leon (3 Replies)
Discussion started by: sabertooth2000
3 Replies
10. Shell Programming and Scripting
Hello, I am new to scripting and need some help. In looking at other posts on this forum, I came up with the following logic. I cannot figure out why I am getting names of files of the current directory in my echo output.
Scenario: message file has a line containing the version. Version.txt... (2 Replies)
Discussion started by: brdholman
2 Replies