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
Inspired by the extremely short awk code from Ygor on this post I wanted to compare two files on only one field. I can't get it to work. Can anybody help on explaining the code and fix the code?
My code which does not work:
awk 'BEGIN{a=1};a!=1' file1.txt file2.txt >outfile.txt
file1.txt... (1 Reply)
Discussion started by: sdf
1 Replies
4. Shell Programming and Scripting
i have two files with identical no of columns. 6th columns is date (MM/DD/YY format) and 7th columns is time (HH:MM:SS) format. I need to compare these two vaules and if the date & time is higher than fileA, save it on fileC; if the value is lower, then save it on fileD
CONDITIONS... (7 Replies)
Discussion started by: ajiwww
7 Replies
5. Shell Programming and Scripting
In first file say first.txt, i have a content say 14:56. In second file, say second.txt i have content say 16:01.... I want to compare if these two times in these 2 files are having a difference of 15 minutes...Can any one please help? (2 Replies)
Discussion started by: manoj.b
2 Replies
6. Shell Programming and Scripting
I have two files and need to compare the two files and to remove the matching lines from both the files (4 Replies)
Discussion started by: shellscripter
4 Replies
7. Shell Programming and Scripting
Dear All,
Is it possible to compare 2 files line to line using column values?
for example I have file1:
1;givi;01012000;wer
2;sss;02012000;rrr
3;ccc;03012000;ttt
file 2:
0;uuu;01012000;lll
1;givi;01012000;wer
2;sss;02012000;rrr
3;ccc;03012000;ttt
5;givi;01012000;hhh
I want... (4 Replies)
Discussion started by: giviut
4 Replies
8. 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
9. UNIX for Dummies Questions & Answers
Hi,
does anyone know of a way to compare files update time (not only days - also hours and minutes) (command? scripts? perl scripts?)
Dori (8 Replies)
Discussion started by: dorilevy
8 Replies
10. UNIX for Dummies Questions & Answers
I need to compare x file with y file.
If x file is newer than y file do xxxx;
(I used touch -t yymmddxxx to chnage the time for y file)
How can i do that?
I tried use
if
then
echo "Xxx";;
fi
But cant....any other good ways to do it? (2 Replies)
Discussion started by: AkumaTay
2 Replies