@ygemici : the file arguments which is fed to awk is to be noted. 20111229.csv *.csv
20111229.csv is fed in twice and hence it takes care of both new and old with the logic.
--ahamed
hmm ok i missed it.
Quote:
Originally Posted by llcooljatt
@ahamed can I say thanks for this code it will save me hours of manual work, 1 thing can you explain
ok think iv worked it out, if my b array index is equal to -1 && (boolean) array a index is not = b index i.e no lines match in array b then {print "NEW:"i";\t\t"b[i]} is that a fair assessment ?
then final version (added to new file to old files)
Dear Unix-Gurus,
I'm trying to write a script to compare the data in a log file. Here's how my logfile will look like:
'List All A0 Data in Destination Server'
A0567
A0678
A0789
List A0 Files in Source Server
A0567
A0678
A0789
So if the file match in Source Server match Destination... (1 Reply)
Hi
I have two files in unix. I need to compare two files and print the differed lines in other file
Eg
file1
1111
2222
3333
file2
1111
2222
3333
4444
5555
newfile
4444
5555
Thanks In advance (3 Replies)
I have learned file comparison from my previous post here. Then, it is comparing the whole line. Now, i have a new problem.
I have two files with 3 columns separated with a "|". What i want to do is to compare the second and third column of file 1, and the second and third column of file 2. And... (4 Replies)
i want to compare two file and print same line
file1
12345 a
23456 a
45678 a
45679 a
file2
23456 a
34567 a
45679 a
output
23456 a
45679 a
any one can help me? Thank you (7 Replies)
Below is the data content of file_1 and file_2:
file_1
>sample_1
FKGJGPOPOPOQA
ASDADWEEWERE
ASDAWEWQWRW
ASDASDASDASDD
file_2
>sample_1
DRTOWPFPOPOQA
ASDADWEEASDF
ASDADRTYWRW
ASDASDASDASDD
I got try the following perl script. Unfortunately, it can't give my desired output result... (7 Replies)
Hello I am a new unix user, and I have a work related task to compare 2 files and print all of the lines in file 2 that contain a string from file 1 Note: the fields are in different columns in the files. I suspect the is a good use for awk? Thanks for your time & help
File 1
123 232 W343... (6 Replies)
Hi,
I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file.
File1 - file2 = file3
wc -l file1.txt
58112
wc -l file2.txt
55260
head -5 file1.txt
101214200123
101214700300
101250030067
101214100500... (10 Replies)
Hi All
I want to compare 2 files using awk and get output of content which is not matching
I have 2 files
a.txt
123
456
780
143
b.txt
A|B|C|167|D|E
C|K|D|123|D|E
A|B|D|789|G|F
C|D|G|143|A|B
Not matching line from b.txt
O/P
A|B|C|167|D|E
A|B|D|789|G|F (3 Replies)
Hello Unix gurus,
I have a file with this format (example values):
label1 1 0
label2 1 0
label3 0.4 0.6
label4 0.5 0.5
label5 0.1 0.9
label6 0.9 0.1
in which:
column 1 is a row label
column 2 and 3 are values
I would like to do a simple operation on this table and get the... (8 Replies)